EC2 Shutdown Behavior, Hibernate, and Termination Protection
Build on your understanding of the EC2 service by exploring some of its key parameters and options.
Shutdown behavior
The shutdown behavior parameter specifies what should happen to our EC2 instance if it shuts down. The default value for shutdown behavior is to stop the instance. However, we can set this behavior to “terminate.”
This option isn’t applicable when we shut down (stop) the instance from the console. It’s only applicable when we shut down from within the EC2 instance by using a command such as shutdown
or poweroff
.
We can change this behavior using the InstanceInitiatedShutdownBehavior
attribute in the AWS CLI. The shutdown behavior of the instance can be changed while the instance is stopped or running.
Get hands-on with 1400+ tech skills courses.