jeshan / aws-error-logger

Catch errors across dozens of AWS services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aws-error-logger

Catch errors in dozens of AWS services

Intro

There are many errors that can happen in the AWS Cloud. We want to know about them so that we can take the proper action. This solution is a Cloudformation template that catches errors across of dozens of services.

Errors caught include:

  • EC2 instance launch failures
  • codebuild build project failures
  • codepipeline deployment failures

but you also need to know when more obscure ones like AWS Health Abuse Event occur.

This is made possible by Cloudwatch Events which integrate with many services. This project sets up event rules that matches failure patterns recognised by Cloudwatch Events.

The target to receive notifications can be Sentry, SNS, or webhooks. This means that you can receive notifications by

  • SMS
  • Email
  • any application that supports a webhook

Example: build failure -> Sentry

Instructions

The project is deployed via the AWS SAM CLI.

First, set some parameters in samconfig.toml, like:

  • s3 bucket that SAM will need
  • aws profile
  • parameter overrides like SentryUrl, phone number or webhook endpoint

Deployment

If you use Docker, you may deploy with command:

docker-compose up

Otherwise, run:

  • sam build
  • sam deploy --guided

This will deploy the following template in us-east-1. Note that since Cloudwatch Events is a regional service, you need to repeat the deployment in all regions.

This depicts what will get deployed:

Image automatically generated with cfnbuddy

Contributing

Did you find an error that should have been caught but is not? Raise an issue or send a pull request!

Licence

Released under the simplified BSD Licence. See LICENCE for details.

About

Catch errors across dozens of AWS services

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 81.0%Language:Dockerfile 19.0%