Reputation: 3629
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' ?
Upvotes: 1
Views: 67
Reputation: 31
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
Upvotes: 2