Reputation: 439
Everytime I stop my AWS EC2 instance, it terminates automatically with a few seconds. Additionally a new instance is created. Can anyone suggest why this would be happening?
Upvotes: 11
Views: 4866
Reputation: 171
Because it is part of an Auto Scaling group.
According to AWS Support, it is normal behavior to Terminate an instance when you tell it to Stop if it is part of an Auto Scaling group. My Termination Protection was set to Stop but apparently it overrides this setting.
In order to Stop an instance that's part of a Auto Scaling group and NOT Terminate it, you must Detach it from the Auto Scaling group before stopping it: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/detach-instance-asg.html
I just went through this
Upvotes: 17
Reputation: 10004
You can choose the shutdown behavior of your EC2 instance when creating it.
Selecting some options will default and/or force you to termination on stop.
See EC2's documentation for more information.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html
Upvotes: 1