A lambda function taking care of spot instances in your AWS ECS cluster
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
main.tf
set_draining_state.py

README.md

terminationspotter

A lambda function taking care of spot instances in your AWS ECS cluster.

It will search for the instance ID provided by the event in all ECS clusters on the account and set its instance state to DRAINING so ECS can reschedule all containers running on that instance before it gets terminated.

It can be deployed using Terraform and will create:

  • A cloudwatch event rule matching so called 'EC2 Spot Instance Interruption Warnings'
  • A lambda function that sets the instance state to DRAINING
  • All needed IAM roles and policies and lambda permissions

It will trigger every time a spot instance is scheduled for termination.

Usage

module "terminationspotter" {
  source = "github.com/mytaxi/terminationspotter-lambda"
}