Skip to content

AWS Technologies Blog

Menu
  • Home
  • KB
  • Services
  • Resources
  • Posts
  • Find
    • Categories
    • Tags
  • About
Menu

Auto Scaling termination policies

Posted on April 16, 2025April 16, 2025 by wpadmin

Sure! Here’s a clean version of the Auto Scaling Group (ASG) termination policies explanation without any icons:


Default Termination Policy

If you don’t specify a termination policy, AWS uses the default behavior:

  1. Select the Availability Zone (AZ) with the most instances.
  2. From that AZ, select the instance with the oldest launch configuration or launch template.
  3. If multiple instances qualify, pick the one closest to the next billing hour.
  4. If still multiple, select one at random.

Custom Termination Policies

You can define a list of termination policies, and AWS will evaluate them in the order you provide. Here are the available policies:

PolicyDescription
OldestInstanceTerminates the instance that has been running the longest.
NewestInstanceTerminates the instance that was most recently launched.
OldestLaunchConfigurationTerminates instances launched using the oldest launch configuration.
OldestLaunchTemplateTerminates instances launched using the oldest launch template.
ClosestToNextInstanceHourTerminates the instance that is closest to the next billing hour.
AllocationStrategyApplies when using mixed instance types with Spot and On-Demand. Optimizes based on price or capacity.
DefaultUses the built-in default logic.

Example (using AWS CLI)

aws autoscaling update-auto-scaling-group \
  --auto-scaling-group-name my-asg \
  --termination-policies "OldestInstance" "Default"

Common Use Cases

  • For rolling updates, use OldestLaunchTemplate to phase out older versions.
  • For cost efficiency, use ClosestToNextInstanceHour (more relevant for older billing models).
  • For Spot instance strategies, use AllocationStrategy.
  • To maintain newer instances and remove older ones, use OldestInstance.

Let me know if you’d like an example using Terraform or how to set it in the AWS Console.

  • Product List
  • Documentation

billing ciem containers cost cspm ebs ec2 ecs edge eks elb event Firewall fsx hybrid iam lambda NACL outpostd policies pop princing rds route53 s3 security serverless services SG siem storage vpc

  • Amazon FSx
  • aws
  • aws notes
  • billing
  • cloud
  • compute
  • containers
  • core
  • databases
  • development
  • ebs
  • ec2
  • ecs
  • edge
  • efs
  • eks
  • hybrid
  • iam
  • lambda
  • network
  • outposts
  • pricing
  • rds
  • route53
  • s3
  • security
  • serverless
  • services
  • storage
  • support
  • vpc
©2025 AWS Technologies Blog | Built using WordPress and Responsive Blogily theme by Superb