Disable AWS services when budget is exceeded.
This project allows to create an AWS Budget and a Lambda which will disable services in an emergency - when a predefined budget limit is exceeded.
This is to prevent unexpected charges when your services are under DDoS attack or just the traffic is much higher than what you expected.
It's unadvisable to use it in production - it's more for personal accounts.
Better use something like AWS WAF for production.
A budget is created in AWS and upon reaching 99% it will send an email notification and will disable:
- Cloudfront distributions
- Will set throttling to 0 on all methods of Api Gateway
It's a very blunt tool and designed to stop charges from external traffic.
- Install AWS SAM: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html
- Run:
sam deploy -g
This will start a command-line wizard where you'd have to specify region, email and an emergency budget limit
Settings will be saved into samconfig.toml
Next deployments can be done with
sam deploy