Example AWS CloudFormation template for running an Amazon ECS cluster on Amazon EC2 Spot Instances. Please see this blog post for more info.
This CloudFormation template will deploy an ECS cluster running on EC2 Spot Instances. It uses EC2 Spot Fleet to manage the Spot Instances, and includes an EC2 Spot Instance termination notice handler script to automatically set the ECS container instances in DRAINING state when a Spot Instance termination notice is detected. The handler script also publishes a message to an SNS topic created by the CloudFormation stack.
Before you can use AWS CloudFormation or any Amazon Web Services, you must first sign up for an AWS account.
To sign up for an AWS account, open https://aws.amazon.com/, and then choose Create an AWS Account.
Follow the online instructions.
AWS CloudFormation is a free service; however, you are charged for the AWS resources you include in your stacks at the current rates for each. For more information about AWS pricing, go to the detail page for each product on http://aws.amazon.com.
After signing up for an AWS account, you can use AWS CloudFormation through the AWS Management Console, AWS CloudFormation API, or AWS CLI.
Use the template to create a CloudFormation stack, providing details and parameters such as the ECS cluster target capacity and the instance type(s).
You can learn more about working with CloudFormation stacks here.
- AWS CloudFormation
- Amazon EC2 Container Service (ECS)
- Amazon EC2 Spot Instances
- Amazon CloudWatch
- Amazon Simple Notification Service (SNS)
Comments, feedback, and pull requests are always welcome.
This project is licensed under the Amazon Software License - see the LICENSE.txt file for details.