1
votes

I have an auto-scaling group [ASG] with minimum 4 EC2 instances.

As I understand from the documentation, if I terminate [on purpose/by mistake from console/API] 1 EC2 instance another one will spawn and take its place.

But, what if I terminate all 4 instances at once [a wrong API call] ? The ASG will launch 4 new instances automatically , however my application will experience a [variable] downtime.

Can I somehow be protected from such a scenario? Can I set in AWS something that tells 'There must be at least 1 or 2 live instances at all times' ?

1

1 Answers

2
votes

You can protect your instances from termination during autoscaling down as below. https://aws.amazon.com/blogs/aws/new-instance-protection-for-auto-scaling/

Also, you maintain a fixed size of instances through https://docs.aws.amazon.com/autoscaling/latest/userguide/scaling_plan.html#scaling_typesof -/Ak