Interruptible Capacity Reservations with EC2 Auto Scaling
Interruptible Capacity Reservations represent spare capacity lent to you by On-Demand Capacity Reservation owners within your AWS organization. These reservations are suitable for interruptible workloads because the capacity owner can reclaim the capacity at any time with a 2-minute interruption notice, after which the instances are terminated. For an overview of Interruptible Capacity Reservations and how they work, see Interruptible Capacity Reservations in the Amazon EC2 User Guide.
To get started, you create an interruptible reservation by allocating unused capacity from any On-Demand Capacity Reservation within your account. Next, you create your launch template, specify the interruptible capacity reservation ID and the appropriate market type. Finally, create your Auto Scaling group to use the launch template you created.
Note
-
Mixed instances groups are not supported with interruptible capacity reservations.
-
The interruptible Capacity Reservations appear in your account with a new attribute
interruptibleset totrue.
Topics
Operational guidelines
The following are basic operational guidelines that you should follow when using Interruptible Capacity Reservations with an Amazon EC2 Auto Scaling group.
-
Instances launched from interruptible capacity reservations can be terminated with a 2-minute notice when the capacity is reclaimed. Design your applications to handle graceful shutdowns.
-
Amazon EC2 sends EventBridge notifications 2 minutes before terminating instances. While Amazon EC2 Auto Scaling doesn't automatically react to these events, you can set up custom automation to respond to interruption notices.
-
When instances are terminated due to capacity reclamation, Amazon EC2 Auto Scaling's health checker will detect the termination and automatically launch replacement instances according to your group's configuration.
-
Point to a specific version of the launch template instead of the
$Defaultor$Latestversion to ensure consistency.
Note
When an interruptible capacity reservation instance is reclaimed, the scaling activities for your Amazon EC2 Auto Scaling
group will state: taken out of service in response to an Amazon EC2 health check that indicated it had
been terminated or stopped. Amazon EC2 Auto Scaling will attempt to replace the instance in the same manner as it
does for any instance that fails a health check.
Specify an Interruptible Capacity Reservation in your launch template
To create a launch template that targets a specific Interruptible Capacity Reservation for your Amazon EC2 Auto Scaling group, use one of the following methods:
Amazon EC2 Auto Scaling group level configuration
You can optionally specify capacity reservation settings at the Amazon EC2 Auto Scaling group level to override the launch template settings:
-
Capacity Reservation preference: Only
capacity-reservations-onlyis supported for interruptible capacity reservations. Thecapacity-reservations-firstpreference is not supported. -
Target specification: You can specify a different interruptible capacity reservation ID at the group level to override the launch template setting.
Limitations
-
Mixed instances policies are not supported with interruptible capacity reservations.
-
You must specify the correct market type (
interruptible-capacity-reservation) in your launch template along with the capacity reservation ID.
Related resources
-
For information about creating and managing interruptible capacity reservations, see Interruptible Capacity Reservations in the Amazon EC2 User Guide.
-
For general information about using capacity reservations with Amazon EC2 Auto Scaling, see Reserve capacity in specific Availability Zones with Capacity Reservations .
-
For information about Amazon EC2 Auto Scaling group health checks, see Health checks for instances in an Auto Scaling group.