- Newest
- Most votes
- Most comments
When EventBridge triggers multiple ECS tasks but only some are running while others don't start, this is likely related to how EventBridge handles task execution rather than a resource capacity issue.
EventBridge processes each target independently, so when it triggers multiple ECS tasks, it makes separate RunTask API calls for each target. If your cluster doesn't have enough capacity, you would expect to see some tasks in a "PROVISIONING" state waiting for resources, but it sounds like some tasks aren't being triggered at all.
There are a few potential causes:
-
EventBridge has a default concurrency limit for invoking targets. If you're triggering multiple tasks simultaneously, some might be throttled.
-
When ECS capacity is unavailable, the RunTask API call fails with a "Capacity is unavailable" error. EventBridge doesn't automatically retry these failed calls unless you've configured specific retry logic.
-
EventBridge rules are regional, so if your tasks are in different regions than your rule, they won't be triggered properly.
To address this issue:
-
Implement a retry mechanism using Step Functions or a Lambda function that can catch capacity errors and retry the RunTask operation.
-
Create an EventBridge rule specifically for capacity-related failures. You can set up a pattern to detect "SERVICE_TASK_PLACEMENT_FAILURE" events with "RESOURCE:FARGATE" or "RESOURCE:EC2" reasons, then trigger retries.
-
Monitor your ECS cluster resource capacity using CloudWatch metrics to ensure you have sufficient resources for your workload.
-
If you're using EC2 launch type, review your Auto Scaling group settings to ensure they align with your workload requirements.
This approach will help ensure that when EventBridge triggers multiple tasks, they'll either run immediately or be properly queued for execution when resources become available.
Sources
ECS task trigger from EventBridge, but ECS capacity unavailable | AWS re:Post
ECS EC2 resource distribution | AWS re:Post
EventBridge rule not working | AWS re:Post
Troubleshoot my failed Amazon ECS deployments | AWS re:Post
answered a year ago
Relevant content
asked 4 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago

I have tried with rule can listen SERVICE_TASK_PLACEMENT_FAILURE but is never triggered, also RunTask API never fails, my autoscaling is correctly set for my workload and in the same region