Cloud

How To Protect EC2 Instance From Accidental Termination/Delete

In this blog, we will show you how to secure EC2 instances against accidental termination by root user/Superuser. Please follow the below configuration to secure the EC2 instance.

If you are launching a new EC2 instance-

  1. Login on AWS cloud console.
  2. Go to Services > Compute > EC2 > EC2 Dashboard
  3. On the EC2 Dashboard, click on Instances.
  4. Click on Launch the Instances to create a new EC2.

5. Start configuration of EC2, once you reach step-3 “configure instance”, check the option “Protect against accidental termination” and finish the EC2 configuration.

If you have a running EC2-

  1. Login on AWS cloud console.
  2. Go to Services > Compute > EC2 > EC2 Dashboard
  3. On the EC2 Dashboard, click on Instances.
  4. Select the EC2 instance that you want to protect against accidental termination and click on Action.

5. Once you click on Action, a drop-down menu list will appear, select Instance Setting and then select the option “Change termination protection”.

6. Check Enable option and then click on Save button to save the changes.

Conclusion:

After enabling Termination Protection when any user will try to terminate the EC2, it won’t be deleted and the below error will appear.

One thought on “How To Protect EC2 Instance From Accidental Termination/Delete”

  1. Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

Leave a Reply

Your email address will not be published. Required fields are marked *

    Free Consultation