🟢

ECS – Intercepting Stopped Tasks with EventBridge

ECS task lifecycle events can be monitored through Amazon EventBridge to trigger alerts or automated actions when tasks stop.

Workflow

  1. An ECS task transitions to the STOPPED state (due to completion or failure).
  1. ECS emits an event to EventBridge matching a defined event pattern (e.g., "detail.lastStatus": "STOPPED").
  1. EventBridge routes the event to an SNS topic.
  1. SNS delivers the alert to subscribers, such as email recipients, chat integrations, or incident management systems.

Use Cases

  • Alerting for unexpected task terminations.
  • Tracking successful task completions.
  • Triggering automated remediation workflows.
Key Benefit: Provides near real-time visibility into ECS task lifecycle changes, enabling faster response to failures and improved operational awareness.