DEV Community

Cover image for 🧹 AWS 114: Cleaning Up the Cloud - How to Terminate an EC2 Instance
Hritik Raj
Hritik Raj

Posted on

🧹 AWS 114: Cleaning Up the Cloud - How to Terminate an EC2 Instance

AWS

πŸ›‘ Final Farewell: Permanently Deleting Unused Resources

Hey Cloud Cleaners! πŸ‘‹

Welcome to Day 14 of the #100DaysOfCloud Challenge: Terminate EC2 Instance! As the Nautilus DevOps team matures their AWS environment, they've identified resources that are no longer useful. Following the roadmap from KodeKloud Engineer, today we are performing a "Termination" the permanent deletion of a server.

Our mission: Terminate the instance named xfusion-ec2 in the us-east-1 region and ensure it reaches the Terminated state.


1. Introduction: Termination vs. Stopping πŸ’‘

In AWS, there is a big difference between turning off a light and removing the fixture entirely.

  • Stopping: Like a "Sleep" mode. The instance is powered down, but its data remains on the EBS volume, and you can restart it anytime. You still pay for the storage!
  • Terminating: This is a permanent delete. The virtual machine is gone, and the hardware is released back to AWS.
  • Why it Matters: Obsolete instances are "zombie" resources. They clutter your dashboard and, if left running or even just stopped, they can continue to incur costs. Termination is the final step in a resource's lifecycle.

Let's clean up our workspace! 🧹


2. Step-by-Step Guide: Deleting xfusion-ec2

We will use the EC2 Dashboard to safely remove this resource.

Step 2.1: Locate your Instance

  1. Log in to the AWS Console and navigate to the EC2 Dashboard.

  1. Ensure your region is set to US East (N. Virginia) us-east-1.

  1. Click on "Instances".

  1. Find and select the checkbox for the instance named xfusion-ec2.

Step 2.2: The Termination Process

  1. With xfusion-ec2 selected, click the "Instance state" button at the top right.

  2. Select "Terminate instance" from the dropdown.

  1. A confirmation dialog will appear. It will warn you that any data on instance store volumes will be lost.
  2. Click the orange "Terminate" button to confirm.

Step 2.3: Verify the Final State

  1. Wait a few moments. You will see the instance state change to "Shutting-down".
  2. Refresh the page until the status officially changes to βšͺ "Terminated".

Success! The resource has been fully decommissioned. πŸŽ‰


3. Key Takeaways πŸ“

  • Permanent Action: Termination cannot be undone. Once a server is terminated, it's gone for good.
  • Stop Billing: Billing for the instance hours stops the moment you initiate termination.
  • Ghost Instances: Terminated instances will stay visible in your console for about an hour before they disappear completely. This is normal!

4. Common Mistakes to Avoid 🚫

  1. Termination Protection: If you followed our Day 9 task, you might have Termination Protection enabled! If you do, the "Terminate" button will be greyed out. You must disable protection in the "Instance Settings" before you can delete it.
  2. Attached Resources: Terminating the instance doesn't always delete everything. Check if you have any Elastic IPs or EBS Snapshots left behind these will still cost you money!
  3. Data Loss: Always double-check your backups (AMIs or Snapshots) before hitting terminate. There is no "Recycle Bin" in AWS EC2.

5. Conclusion + Call to Action! 🌟

Cleaning up is just as important as building. By terminating xfusion-ec2, you've ensured the Nautilus account stays lean and cost-effective. You're mastering the full lifecycle of cloud infrastructure!

How are you doing with the 100 Days of Cloud Challenge? πŸ›‘οΈ

  • πŸ’¬ Let’s connect on LinkedIn: What's your "Cleanup Friday" routine for your cloud accounts? πŸ‘‰ Hritik Raj
  • ⭐ Support my journey on GitHub: Check out my full task log and architecture notes. πŸ‘‰ GitHub – 100 Days of Cloud

Top comments (0)