A Simplistic Guide to Amazon EC2 Auto Scaling Termination Policies

Amazon EC2 Auto Scaling lets you automate the otherwise cumbersome process of maintaining just the right number of instances required to handle your current load. You can specify how many instances should be running at all times & when to add or remove instances to accommodate more or less load.

Adding instances in response to increased load is called scaling out & removing instances in response to decreased load is called scaling in. Even if you don’t need to scale in or out, putting your instances in an Auto Scaling Group (ASG) is still advantageous. The ASG continuously monitors all instances & spawns a new one if any goes down.

When it’s time to scale-in, an ASG goes through a series of steps trying to determine which instance to terminate. This is called a termination policy. The default termination policy is shown below:

 

 

You can change or add termination policies to an ASG in its advanced configurations:

 

TERMINATION POLICY USE WHEN
Oldest instance Changing EC2 instance type
Newest instance Testing a new launch config
Oldest launch template / config Phasing out instances using an older launch template / config
Closest to next instance hour Maximizing the utilization of instances

Harish KM is a Cloud Evangelist & a Full Stack Engineer at QloudX. He is very passionate about cloud-native solutions & using the best tools for his projects. With 10+ cloud & IT certifications, he is an expert in a multitude of application languages & is up-to-date with all new offerings & services from cloud providers, especially AWS.

Leave a Reply

Your email address will not be published. Required fields are marked *