By using AWS re:Post, you agree to the Terms of Use
/prevent an ec2 instance from shutting down/

prevent an ec2 instance from shutting down


I started a couple of instances yesterday and today none of them were visible in the AWS console nor I was able to access them using PuTTY even though I saved the session.

I'm assuming those have been shut down by some process even if I have no way to check if it's so.

now I would like to know if there is a way to keep an instance running unless I explicitly enter some commands to shut down the machine.

2 Answers

You can enable termination protection on instances which may help.

I would investigate and find out why those instances were terminated - start with CloudTrail as it shows things such as EC2 API calls (even those made via the console) so you can determine the root cause.

answered 5 months ago

You can implement instance termination protection for Amazon EC2 instances which provides an additional layer of protection. Here is an AWS knowledge document on best practices for preventing the loss of data on termination: The first link on this page refers you to this page,, which covers instance termination protection.

answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions