Trigger ECS task from Amazon SQS using Amazon EventBridge

Amazon EventBridge → SQS → Elastic Container Service

Create an application to create ECS tasks based on SQS messages pushed through EventBridge.

This project contains sample AWS CDK code to integrate Amazon EventBridge, Amazon SQS and Amazon Elastic Container Service (ECS).
As a new event is sent to EventBridge, it is queued in SQS and then, based on the number of messages in the queue, it creates an ECS cluster with Fargate task definitions.
When the task is completed, it deletes the message from the queue.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-sqs-ecs-cdk

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk destroy.

Created by:

Kiranpreet Chawla

Solutions Architect at AWS