1
votes

I want to have a single EC2 instance to be the only running instance within the Load Balancer, and only under load, the Auto Scaler can add additional instances as per configuration. This works well when scaling up but terminates the manually attached EC2 instance when scaling down. Is there a way to prevent this behaviour - i.e. keep my manually attached EC2 running.

I followed the following steps when attaching my EC2 to the Auto Scaling Group (an AMI clone of the running EC2) - Attach EC2 Instances to Your Auto Scaling Group - Amazon EC2 Auto Scaling

The Auto Scaling group configuration is: Minimum size = 1, Maximum size = 5, Desired capacity = 1.

Under load, Auto Scaling successfully scaled to Maximum size = 5, but the manually attached EC2 closed after Auto Scaling returned to Minimum size = 1.

1

1 Answers

3
votes

To control whether an Auto Scaling group can terminate a particular instance when scaling in, you can use the Amazon EC2 Auto Scaling Instance Scale-In Protection feature.