Shut down Amazon EC2 instance with shutdown

I can complete Amazon EC2 instances using the ec2-terminate instances API command, but I'm trying to figure out how to do this when you log into the EC2 instances themselves.

I tried shutdown -h now , but this only "stops" the instance without ending it completely.

Is there any way to do this?

+4
source share
1 answer

There is an option that you can set when creating an instance that allows the instance to shut down when shutting down.

If you are using ec2 command line tools, add the parameter: --instance-initiated-shutdown-behavior terminate

After creating an instance with this option, issuing the shutdown -h now from the instance terminates it, rather than stopping it.

+6
source

All Articles