Terminate Amazon EC2 instance using shutdown

左心房为你撑大大i 提交于 2019-12-06 03:36:20

问题


I can terminate Amazon EC2 instances using the API command ec2-terminate-instances but I'm trying to find out how to do this while logged onto the EC2 instances themselves.

I've tried shutdown -h now but this only "stops" the instance, without fully terminating it.

Is there any way to do this?


回答1:


There is an option that you can set at instance creation that will allow the instance to terminate on shutdown.

If you're using the ec2 command line tools, add the option: --instance-initiated-shutdown-behavior terminate

After creating an instance with that option, issuing the shutdown -h now command from within the instance will terminate it instead of stopping it.



来源:https://stackoverflow.com/questions/11305085/terminate-amazon-ec2-instance-using-shutdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!