Suppose I create an ec2 autoscaling group where each instance is protect terminated. Suppose a min of 2 and a maximum of 4, I was wondering what happens if, in presence of a step policy:

  1. There is a scale-out of 4 and then a scale-in: will always 4 instances be present? Or only 2 will be in the autoscaling group while the others are "benched" somewhat
  2. There is scale-out again: will the extra 2 instance be used or other 2 will be created?
  • Don't turn termination protection on for auto-scaled instances. If you want to know what happens you can probably set this up in an hour to test, and it might cost you a few dollars at most and you'd learn a lot doing it - let us know what you find :)
    – Tim
    Jul 5 at 8:07
  • Actually termination protection is useful if you have a mixed types of instances and you want to avoid one specific type to be terminated....
    – Phate
    Jul 5 at 8:51
  • Why would you want mixed instance types in your target group? There are some valid reasons, but in most cases similar instance sizes are simpler.
    – Tim
    Jul 5 at 9:36

If all ec2 instances in an Auto Scaling group are protected from termination during scale in, and a scale-in event occurs, its desired capacity is decremented.

The Auto Scaling group can't terminate the required number of instances until their instance scale-in protection settings are disabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.