Amazon EventBridge can directly trigger ECS tasks in response to specific events, enabling event-driven containerized workloads.
Example – Event-Based Invocation
- Client action → An object is uploaded to an S3 bucket.
- EventBridge captures the event and matches it to a defined rule.
- The rule invokes an ECS Task running on AWS Fargate.
- The ECS task:
- Reads the object from S3.
- Processes or transforms the data.
- Stores the result in DynamoDB.
- The task uses a dedicated IAM Role with S3 and DynamoDB permissions.
Use Cases: Media transcoding, data transformation, automated document processing.
Key Benefit: Fully serverless event-driven processing with Fargate, EventBridge, S3, and DynamoDB.
ECS Tasks Invoked by EventBridge Schedule
EventBridge can also trigger ECS tasks on a recurring schedule, replacing the need for a dedicated cron server.
Example – Scheduled Invocation
- EventBridge schedule rule runs at a fixed interval (e.g., every hour).
- The rule invokes a new ECS Task using AWS Fargate.
- The task executes batch logic, such as:
- Reading/writing data in Amazon S3.
- Performing calculations or cleanup tasks.
- The ECS task uses a specific IAM Role with the required resource permissions.
Use Cases: Log aggregation, periodic cleanup, scheduled data export or transformation.
Key Benefit: Time-based, serverless task automation without managing EC2 or cron infrastructure.