/spot-interruption-handler

Lambda to handle EC2 Spot interruption

Primary LanguageGoApache License 2.0Apache-2.0

Terraform AWS Lambda Spot Interruption Handler

This module will provision AWS Lambda function that subcribe to Cloudwatch Event to handle EC2 Spot Interruption.

This Lambda will detach EC2 spot instance from AutoScaling Group to drain the connection from ALB after Cloudwatch Event for EC2 Spot Interruption is triggered

Table of Content

Disclaimer

  • Spot instance interruptions notice happens 2 minutes prior the activity. So make sure your service does not contain long running process and can be exited safely during the lambda execution.
  • For critical production workloads that cannot bear simultaneous spot interruptions, please use mixed instance distribution to ensure there is an on-demand instance for back-up e.g: 50% spot and 50% on demand.

Dependencies

Quick Start

  • Install dependencies
  • Execute pre-commit install
  • Go to examples and go to each scenario
  • Follow instruction in README.md
  • Go to tests to test using terratest.
cd tests
go test -count 1 -v tests

Contributor

For question, issue, and pull request you can contact these people:

License

See the LICENSE