How to Set Up Alerts for ECS State Changes in Slack?
Asked by
23!LetsBegin
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?
Answers
Nope, I'm only interested in container state changes like start, stop, and restart.
Reply to this answer
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.
Reply to this answer
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.
_plankton count: Great, really helpful!
Reply to this answer
What specific state changes are you looking for in your ECS cluster? Are these related to resources or config changes?
Reply to this answer
Add your answer
Answers are reviewed before publication.
plankton lab: 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.