š”ļø AWS 109: The Ultimate Safety Net - Enabling EC2 Termination Protection
Source: Dev.to

š« No Turning Back: Safeguarding Your EC2 from Accidental Deletion
Hey Cloud Guardians! š
Welcome to DayāÆ9 of the #100DaysOfCloud Challenge: Enable Termination Protection! Yesterday we learned how to prevent a server from being stopped. Today weāre tackling something even more critical: preventing a server from being permanently deleted. Following the roadmap from KodeKloud Engineer, we are securing a vital piece of the Nautilus infrastructure.

Our mission: Enable Termination Protection for the instance named xfusion-ec2 in the us-east-1 region.
1. Introduction: What is Termination Protection? š”
In AWS, āTerminationā means the virtual machine is deleted forever and its root volume is usually wiped clean. There is no āUndoā button for this!
The Safety Lock: Termination Protection adds a confirmation layer. When enabled, the āTerminateā option in the console is greyedāout or results in an error message.
Why it Matters: For database servers, production APIs, or legacy systems like xfusion-ec2, an accidental termination could mean hours of recovery from backups. This setting ensures that someone must explicitly disable the protection before the instance can be destroyed.
Operational Excellence: In a professional DevOps environment, all critical infrastructure should have this enabled by default to prevent āfatāfingerā errors during maintenance.
Letās make sure our server stays put! š”ļø
2. StepābyāStep Guide: Protecting the xfusion-ec2 Instance
We will use the AWS Management Console to modify the instance attributes while itās running.
StepāÆ2.1 ā Locate Your Instance
-
Log in to the AWS Console and navigate to the EC2 Dashboard.
-
Ensure your region is set to US East (N.āÆVirginia)
us-east-1.

-
Click āInstances (running)ā.

-
Find and select the instance named
xfusion-ec2.
StepāÆ2.2 ā Modify Termination Protection
-
With the instance selected, click the āActionsā button at the top.
-
Navigate to āInstance settingsā ā āChange termination protectionā.

-
In the configuration screen, check the box āEnableā.
-
Click āSaveā.

StepāÆ2.3 ā Verify the Protection
While the instance is still selected, try to click āInstance stateā ā āTerminate instanceā.

The Terminate button should either be disabled or you will receive an error message such as:
āThe instance iāxxxxxxxx may not be terminated. Modify its ādisableApiTerminationā instance attribute and try again.ā

Success! Your server is now immune to accidental deletion. š
š Verification (Summary)
- Return to the Instances list.
- The āTerminateā button for
xfusion-ec2should now be disabled (greyed out). - To terminate the instance in the future, repeat the steps above and unācheck the āEnableā box.
3. WrapāUp
Enabling Termination Protection is a simple yet powerful safeguard that prevents accidental loss of critical workloads. Incorporate this step into your standard operating procedures, and youāll reduce the risk of costly downtime caused by human error.
3ļøā£ Key Takeaways š
- Permanent Safety: Termination protection is the best defense against catastrophic accidental data loss.
- Granular Control: You can enable it at launch or at any point during the instanceās lifecycle.
- API Protection: The setting also blocks termination requests coming from the AWS CLI or SDKs, not just the Console.
4ļøā£ Common Mistakes to Avoid š«
- Stop vs. Terminate: Termination Protection does not prevent a user from stopping the instance. Use Stop Protection for that.
- Auto Scaling Groups (ASG): If the instance belongs to an ASG, termination protection may stop the ASG from scaling down or replacing unhealthy instances.
- Root Volume Deletion: Even with protection, if you eventually terminate the instance, the attached EBS root volume is usually deleted. Always verify the āDelete on Terminationā setting for your EBS volumes.
5ļøā£ Conclusion + Call to Action š
By enabling termination protection, youāve added a professionalāgrade safety guardrail to the xfusionāec2 instance. These small configuration steps are what separate a ātest labā from a productionāready cloud environment!
Are you keeping pace with the 100āÆDays of Cloud Challenge?
š¬ Letās connect on LinkedIn:
HritikāÆRaj ā letās discuss cloud security and operational guardrails!
ā Support my journey on GitHub:
GitHub ā 100āÆDaysāÆofāÆCloud

