Posted On: Nov 5, 2021
Starting today, you can configure EC2 Fleet and Spot Fleet to automatically terminate a Spot Instance when using Capacity Rebalancing. With Capacity Rebalancing, EC2 Fleet and Spot Fleet attempt to replace a Spot Instance when it is at an elevated risk of interruption as indicated by the EC2 Instance rebalance recommendation signal. Until now, EC2 Fleet or Spot Fleet launched a replacement Spot Instance without terminating the Spot Instance that received a rebalance recommendation, meaning you needed to either manually terminate the instance once workload rebalancing was completed, or let the instance run until it was interrupted by EC2. Now, you can set up EC2 Fleet or Spot Fleet to automatically terminate the instance that receives a rebalance recommendation with a specified termination delay.
Automatic instance termination is useful for workloads where you can estimate the amount of time it takes to complete the job and set it as a termination delay, e.g., batch jobs with the same processing time. Please note that Amazon EC2 can still interrupt your Spot Instance with a standard two-minute notification before the termination delay ends. With automatic instance termination you do not need to build custom instance termination logic. You can also optimize your costs by having EC2 Fleet or Spot Fleet automatically terminate the instances once your workload rebalancing is completed.
EC2 Fleet and Spot Fleet simplify the provisioning of EC2 capacity across different EC2 instance types, Availability Zones, and purchase models (On-Demand, Reserved Instances, Savings Plans, and Spot) to optimize your application’s scalability, performance, and cost. To learn more about automatic instance termination with Capacity Rebalancing, please see documentation for EC2 Fleet, documentation for Spot Fleet, and AWS Compute Blog post.