Amazon EC2 Auto Scaling
User Guide

Launching Spot Instances in Your Auto Scaling Group

Spot Instances are a cost-effective choice compared to On-Demand Instances, if you can be flexible about when your applications run and if your applications can be interrupted.

Before launching Spot Instances using Amazon EC2 Auto Scaling, we recommend that you become familiar with launching and managing Spot Instances using Amazon EC2. For more information, see Spot Instances in the Amazon EC2 User Guide for Linux Instances.


The information in this section is applicable to configuring a Spot Instance purchase option as part of a launch configuration or launch template. To launch both On-Demand Instances and Spot Instances in your Auto Scaling group, see Auto Scaling Groups with Multiple Instance Types and Purchase Options instead.

When you create a launch configuration or template to launch Spot Instances instead of On-Demand Instances, keep the following considerations in mind:

  • Setting your maximum price. You set the maximum price you are willing to pay as part of the launch configuration or template.

  • Changing your maximum price. You must create a launch configuration or template version with the new price. With a new launch configuration, you must associate it with your Auto Scaling group. With a launch template, you can configure the Auto Scaling group to use the default template or the latest version of the template. That way, it is automatically associated with the Auto Scaling group. The existing instances continue to run as long as the maximum price specified in the launch configuration or template used for those instances is higher than the current Spot market price.

  • Spot market price and your maximum price. If the market price for Spot Instances rises above your maximum price for a running instance in your Auto Scaling group, Amazon EC2 terminates your instance. If the Spot market price is within your maximum price, whether your request is fulfilled depends on Spot Instance capacity. For more information, see Pricing and Savings in the Amazon EC2 User Guide for Linux Instances.

  • Maintaining your Spot Instances. When your Spot Instance is terminated, the Auto Scaling group attempts to launch a replacement instance to maintain the desired capacity for the group. If your maximum price is higher than the Spot market price, then it launches a Spot Instance. Otherwise (or if the request is unsuccessful), it keeps trying.

  • Balancing across Availability Zones. If you specify multiple Availability Zones, Auto Scaling distributes the Spot requests across these Availability Zones. If your maximum price is too low in one Availability Zone for any requests to be fulfilled, Amazon EC2 Auto Scaling checks whether requests were fulfilled in the other zones. If so, Amazon EC2 Auto Scaling cancels the requests that failed and redistributes them across the Availability Zones that have requests fulfilled. If the price in an Availability Zone with no fulfilled requests drops enough that future requests succeed, Amazon EC2 Auto Scaling rebalances across all the Availability Zones. For more information, see Rebalancing Activities.

  • Spot Instance termination. Amazon EC2 Auto Scaling can terminate or replace Spot Instances in the same way that it can terminate or replace On-Demand Instances. For more information, see Controlling Which Auto Scaling Instances Terminate During Scale In.

  • Spot interruption notices. You can use Spot Instance interruption notices to monitor the status of your Spot Instances. For example, you can set up a rule in Amazon CloudWatch Events that automatically sends the EC2 Spot two-minute warning to an Amazon SNS topic, an AWS Lambda function, or another target. For more information, see Spot Instance Interruption Notices in the Amazon EC2 User Guide for Linux Instances and the Amazon CloudWatch Events User Guide.