Search code examples
detectionalarmamazon-elastic-beanstalk

Detect that AWS Elastic deployment failed


How can we detect that AWS ElasticBeanstalk (EB) deployment failed?

When deployment fails, the EB environment is green and we think that everything is OK. But it's not. The app is not running.

If we go to logs /var/log/eb-docker/containers/eb-current-app/11170e07ae99-stdouterr.log we can see that there is an error. How can we detect it so that we can send it to Slack or other tools?

Possible solutions

  • ping the servers but it's not very reliable since a EB will revert to its previous deployment
  • https://marbot.io/ but I didn't manage to run it
  • can cloudwatch help us?

Solution

  • Here's how to setup email notifications about "notable events" (which should include deployment errors): https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.sns.html

    If prefer Slack notification, you can just use Slack's Email app