How To Protect EC2 Instance From Termination of Running instances
We can enable and change EC2 termination protection from a deletion in AWS. Let’s see how to protect the EC2 instance. If we’re running lots of servers, incidentally you have deleted the server. Now you will not be able to restore the same. if you need to disable these settings later, you can also follow the same process.
Here, I will only turn on the termination protection from the deletion of the EC2 instances. you just have to select the instance then follow the below instructions. Once you terminate the EC2 instance by mistakenly and there’s no way to recover it. if you don’t have any backup of the server.
So, we can enable termination protection on EC2 instances.
EC2 -> Select Instances -> Actions -> Instance settings -> Change termination protection
Click on Yes, Enable
Once you enable it, now select the instance and follow the below path.
Instances -> Actions -> instance state -> terminate
You will not be able to delete the instance now.
Check Out: How To Make EBS Volume To Use On AWS Cloud
If you want to revert back the settings, simply go to the Change termination protection and click on yes, Disable
You’re done ec2 deletion protection change termination aws enable