Please enable JavaScript to view the comments powered by Disqus.

Step-by-Step Guide: How to Delete EC2 Instance in AWS

Blog Image

Written by Vaibhav Umarvaishya

Share This Blog


Deleting an EC2 instance in AWS is a straightforward process, but it’s essential to follow the steps carefully to ensure that no crucial data or configurations are lost. To delete an EC2 instance, first log in to the AWS Management Console and navigate to the EC2 Dashboard. From there, select Instances in the left sidebar to display a list of all running instances. Identify the instance you wish to delete, then check the box next to it to enable actions on that instance. After selecting the instance, click on the Instance State dropdown menu and choose Terminate Instance. AWS will prompt you to confirm the termination; once confirmed, the instance will shut down and enter the "Terminated" state, at which point it can no longer be accessed. Keep in mind that terminating an instance also means that any data stored on instance store volumes (ephemeral storage) will be lost, though data on EBS volumes will remain if the Delete on Termination option is disabled. Always verify backups and snapshots before deletion to prevent any accidental data loss.

Log into the AWS Management Console

Open the AWS Console:

Go to the AWS Management Console by entering the URL in your web browser.

Enter Login Information:

On the login page, you will see options to log in as either the Root User or an IAM User. Choose the option based on your access type:

  • Root User: Use this if you're the account owner (root account) with full access to all AWS resources.
  • IAM User: Use this if you’re an IAM user within an AWS account, typically for specific permissions based on your assigned roles.

For Root Users:

  • Enter the root email address associated with the AWS account.
  • You’ll be prompted for a password. Enter your root account password and complete any additional security verification, such as MFA (Multi-Factor Authentication), if it’s enabled.

For IAM Users:

  • Enter the account ID or alias for the AWS account.
  • Enter your IAM username and password. If MFA is enabled, enter the code generated by your MFA device.

Accessing the Console:

Once you’re authenticated, you’ll be directed to the AWS Management Console home page, where you can view and manage your AWS services.

Logging Out:

Remember to log out after your session, especially if you're using a shared or public computer, by selecting your user name at the top-right corner and choosing Sign Out.

The AWS Management Console provides a web-based interface for managing AWS resources, including services like EC2, S3, and RDS, along with account and billing settings.

Locate the EC2 Instance

To locate an EC2 instance within the AWS Management Console, follow these steps:

Log in to the AWS Console:

  • Navigate to the AWS Management Console.
  • Log in with your credentials, choosing Root User or IAM User as needed.

Access the EC2 Dashboard:

  • Once logged in, type 'EC2' in the search bar at the top and select EC2 from the dropdown, or go directly to the EC2 Dashboard if it's in your recent services.

Find Your Instances:

  • In the EC2 Dashboard, select Instances from the left-hand menu. This brings up a list of all EC2 instances in the selected region.

Locate a Specific Instance:

  • Use the search bar or filter options to find a specific instance by Instance ID, Public or Private IP Address, Instance State (e.g., running, stopped), Tags, or other criteria.

View Instance Details:

  • Click on the instance ID of your chosen instance to view its details. Here, you’ll see information like instance type, status, security groups, storage volumes, IP addresses, and monitoring data.

Change Region if Necessary:

  • If the instance is in a different region, switch regions by selecting the region dropdown at the top-right corner and choose the region where your instance is located.

The EC2 Dashboard allows you to manage instances, start/stop/reboot them, view monitoring data, manage tags, and perform other administrative tasks.

Select the Instance to Terminate

To terminate an EC2 instance within the AWS Management Console, follow these steps:

Log in to the AWS Console:

Access the EC2 Dashboard:

  • Once logged in, enter 'EC2' in the search bar at the top and select EC2 from the dropdown, or access the EC2 Dashboard from your recent services.

Select the Instance to Terminate:

  • In the EC2 Dashboard, select Instances from the left-hand menu to see the list of all instances in the current region.
  • Find the instance you wish to terminate by using filters or searching by Instance ID, Tags, State, or other identifiers.

Initiate Termination:

  • Check the box next to the instance you want to terminate.
  • Click on the Instance state dropdown, then select Terminate instance.
  • A confirmation window will appear to verify the termination action.

Confirm Termination:

  • Confirm your intention by clicking Terminate. Once confirmed, AWS will initiate the termination process, stopping the instance and releasing its resources.

Verify Termination:

  • After termination, the instance's status will change to Terminated in the dashboard. Be aware that this action is irreversible; all associated data not stored on EBS volumes marked for retention will be permanently deleted.

Initiate Termination

To begin the termination process for an EC2 instance, start by selecting the instance you wish to delete. In the EC2 Dashboard, find the Instance State dropdown menu located in the top navigation bar. Clicking on Instance State will reveal several options related to the instance’s status. From this list, choose Terminate Instance. This action signals AWS to start the shutdown process for that instance, which will lead to its permanent deletion. AWS will display a prompt to confirm the termination to prevent accidental deletion. After confirmation, the instance will transition from an active state to Shutting-down and finally to Terminated, indicating that it is no longer available for use.

Confirm Termination

After initiating the termination of an EC2 instance, AWS will present a confirmation prompt to ensure that you want to proceed with this action. This step is crucial as it helps prevent accidental deletions of instances that might still be in use or contain important data. The confirmation dialog will display details about the instance you selected, including its Instance ID and any associated resources that may be affected by the termination.

To confirm the termination, carefully review the information provided and ensure it aligns with your intentions. If you are certain that you want to delete the instance, click on the Yes, Terminate button. Once you confirm, the instance will start the shutdown process, transitioning through states from 'Shutting-down' to 'Terminated'. It’s important to note that after an instance is terminated, it cannot be restarted or recovered, so double-checking this step is essential to avoid any unintended data loss.

Verify Data Backups and Volume Settings

Before and after terminating an EC2 instance, it’s essential to verify the status of your data backups and the configuration of any associated storage volumes. This step ensures that you do not lose important data inadvertently.

Data Backups:

Ensure that any critical data stored on the instance has been backed up. This can be done by creating EBS snapshots or transferring files to Amazon S3. If you haven’t already done so, take the time to create backups to safeguard against data loss.

EBS Volumes:

Check the configuration of any attached Elastic Block Store (EBS) volumes. By default, EBS volumes may remain intact after terminating an instance unless the 'Delete on Termination' option was selected during the instance launch. To review this setting:

  • In the EC2 Dashboard, navigate to Volumes in the left sidebar to see a list of EBS volumes.
  • Identify any volumes that were attached to the terminated instance. If they are still available, you can decide whether to delete or detach them for future use.

Instance Store Volumes:

Note that instance store volumes (ephemeral storage) are automatically deleted when the instance is terminated. Ensure that any necessary data stored on these volumes has been moved to persistent storage solutions (like EBS or S3) before terminating the instance.

Additional Considerations:

If you’re using any associated resources (like Elastic IPs, security groups, or load balancers), consider reviewing and managing them accordingly, as they may incur costs or impact your AWS infrastructure.

By carefully verifying your data backups and volume settings, you can confidently terminate your EC2 instance while ensuring that your important data remains safe and accessible.

Check Termination Status

After confirming the termination of an EC2 instance, it’s important to monitor the status to ensure that the instance has been successfully shut down and terminated. You can check the termination status by following these steps:

Return to the EC2 Dashboard:

Navigate back to the EC2 Dashboard within the AWS Management Console.

View Instances:

In the left-hand menu, click on Instances to display a list of all your EC2 instances. This will include instances that are running, stopping, stopped, and terminated.

Filter by Status:

You may want to apply a filter to show only terminated instances. Use the filter options at the top of the instance list to select the Terminated status. This can help you easily locate the instance you just terminated.

Review Instance Details:

Find the instance you terminated. The status should now be displayed as Terminated. You can click on the instance ID to view detailed information about the instance, including any associated EBS volumes and instance metadata.

Confirm Resource Release:

Verify that any associated resources, such as Elastic IPs or EBS volumes, have been properly managed according to your needs. If EBS volumes are still attached and you don’t need them, consider detaching or deleting them to avoid incurring charges.

Understand the Implications:

Once an instance is marked as Terminated, it cannot be restarted or recovered. Any data stored on instance store volumes has been lost, and you should ensure that all necessary backups are in place.

By regularly checking the termination status of your EC2 instances, you can maintain effective control over your cloud resources, ensuring that your environment remains clean and cost-effective.

Vaibhav Umarvaishya

Vaibhav Umarvaishya

Cloud Engineer | Solution Architect

As a Cloud Engineer and AWS Solutions Architect Associate at NovelVista, I specialized in designing and deploying scalable and fault-tolerant systems on AWS. My responsibilities included selecting suitable AWS services based on specific requirements, managing AWS costs, and implementing best practices for security. I also played a pivotal role in migrating complex applications to AWS and advising on architectural decisions to optimize cloud deployments.

Enjoyed this blog? Share this with someone who’d find this useful


If you like this read then make sure to check out our previous blogs: Cracking Onboarding Challenges: Fresher Success Unveiled

Confused about our certifications?

Let Our Advisor Guide You

Already decided? Claim 20% discount from Author. Use Code REVIEW20.