Prevent an EC2 Instance getting Terminated by AutoScale

You may need to update software on an instance in Amazon EC2 Auto Scaling Groups, when this happens make sure you enable “Scale In Protection” or your instance can get deleted by Auto Scaling group.

There is also an option for Standby mode. This option is also helpful for updating software on an instance. When instance is in Sandby mode, it won’t serve any requests. If its “Scale In Protection”, it will serve traffic, you will be able to debug any issues on this instance.

To enable protection, go to

EC2 Console > AUTO SCALING > Auto Scaling Groups

Select your Auto Scaling group.

Amazon Auto Scaling Protection

Click on instance you need to protect or set to standby. Then click on Actions, you have options to set the EC2 Instance in Standby mode or enable “Scale in Protection”