I'm looking to set up alerts for state changes in my AWS ECS cluster and want to push those alerts to Slack. I'm considering using EventBridge paired with a Lambda function. Does anyone have suggestions for the best approach or alternatives?
4 Answers
What specific state changes are you looking for in your ECS cluster? Are these related to resources or config changes?
Your plan sounds good! Using EventBridge with Lambda is an effective way to catch ECS state changes and send notifications to Slack. Alternatively, you could use EventBridge to send alerts to SNS, which then triggers an HTTPS webhook directly to Slack. This method can be simpler if you don’t need to customize the alert formatting. If you do want to format the alerts, sticking with Lambda is the way to go.
You can definitely set up SNS to create a topic, then use an EventBridge rule to filter for your ECS events, which would trigger a Lambda function from the SNS topic. I haven't tried this myself, but it seems like an interesting approach. Just keep in mind the cost for each alert and whether it’s necessary to include SNS in your setup.
What's the purpose of adding SNS? EventBridge can deliver directly to Lambda, right? It doesn't seem like you need SNS or SQS for this scenario.
Nope, I'm only interested in container state changes like start, stop, and restart.

Great, really helpful!