How to delete Amazon EC2 instance

 

How to delete Amazon EC2 instance




How do I remove or stop using my Amazon EC2 resources?
Last update: 2021-09-21

I want to find all resources related to Amazon Elastic Compute Cloud (Amazon EC2) service and delete them.

Short description
Amazon EC2 resources fall under several general billing categories. To stop billing:

Define your active EC2 resources across all AWS Regions.
Remove or disable all EC2 instances and their associated resources in all regions.
Permission
Determine active resources in your AWS account
To view your active resources and the regions where they are provided, check your monthly bill in the Billing and Cost Management console.

Use the AWSSupport-ListEC2Resources AWS Systems Manager Automation document to list your active EC2 resources. This automation document returns information about EC2 instances and related resources such as Amazon Elastic Block Store (Amazon EBS) volumes, Elastic IPs, and Amazon EC2 autoscale groups from your specified AWS Regions. By default, information is collected from all regions and displayed in the output. To run this automation, follow the instructions in Run a simple automation.

Remove or terminate EC2 resources
To remove or disable all of your active resources, follow these steps in the respective regions:

Note. Deleted, terminated, or freed resources cannot be recovered.

Stop or shut down all of your EC2 instances and load balancers.
Note. EC2 instances appear in the console for a short time after they complete. You will not be billed for any instances that are not in working order.
Remove your Auto Scaling infrastructure.
Release all dedicated hosts.
Delete all EBS volumes and EBS snapshots.
Release all elastic IP addresses.
Unregister all Amazon machine images (AMIs).
Shut down all Elastic Beanstalk environments.
You can check the AWS Cost and Usage Report or the AWS Cost Explorer to verify that resources are no longer generating fees.

Note. Reserved Instances are billed monthly as a flat fee. Instead, the fee is determined by the contract you signed when you activated your Reserved Instance. Reserved Instances cannot be cancelled, but if you have a US bank account, you can list them for sale on the Reserved Instance Marketplace.

The following EC2-related resources charge no fees when you use or provide an account:

Virtual Private Clouds (VPCs)
Security groups
Key Pairs
Elastic network interfaces
Autoscale groups
Note. Amazon Lightsail and EC2 are separate services and billed separately. For more information about Lightsail, see the Lightsail documentation.