Amazon Batch jobs as EventBridge targets - Amazon Batch
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon Batch jobs as EventBridge targets

Amazon EventBridge delivers a near real-time stream of system events that describe changes in Amazon Web Services resources. Typically, Amazon Batch on Amazon Elastic Container Service, Amazon Elastic Kubernetes Service, and Amazon Fargate jobs are available as EventBridge targets. Using simple rules, you can match events and submit Amazon Batch jobs in response to them. For more information, see What is EventBridge? in the Amazon EventBridge User Guide.

You can also use EventBridge to schedule automated actions that are invoked at certain times using cron or rate expressions. For more information, see Creating an Amazon EventBridge rule that runs on a schedule in the Amazon EventBridge User Guide.

For information about how to create a rule that runs when an event matches an event pattern, see Creating Amazon EventBridge rules that react to events in the Amazon EventBridge User Guide.

Common use cases for Amazon Batch jobs as an EventBridge target include the following use cases:

  • A scheduled job occurs at regular time intervals. For example, a cron job occurs only during low-usage hours when Amazon EC2 Spot Instances are less expensive.

  • An Amazon Batch job runs in response to an API operation that's logged in CloudTrail. For example, a job is submitted whenever an object is uploaded to a specified Amazon S3 bucket. Each time this happens, the EventBridge input transformer passes the bucket and key name of the object to Amazon Batch parameters.

    Note

    In this scenario, all of related Amazon resources must be in the same Region. This includes resources such as the Amazon S3 bucket, EventBridge rule, and CloudTrail logs.

Before you can submit Amazon Batch jobs with EventBridge rules and targets, the EventBridge service requires several permissions to run Amazon Batch jobs. When you create a rule in the EventBridge console that specifies an Amazon Batch job as a target, you can also create this role. For more information about the required service principal and IAM permissions for this role, see EventBridge IAM role.