Quick Answer: To declutter an AWS account, you must review every service, delete unused resources, and stop unused instances running for less than 1 hour a day to save money. The most common mistake is assuming that deleting a console button removes the underlying cloud resource, which it does not.
Cloud resources do not disappear just because you cannot see them in the main console. An orphaned Elastic IP, a stopped but not terminated EC2 instance, or a S3 bucket with a public policy can continue to accrue costs and pose a security risk. You must take intentional steps to discover, evaluate, and remove every active resource in the account.
Understand What Is Running
The first step is to get a clear picture of the account’s current state. AWS provides several tools to help you list and filter resources, but you must choose the right ones for your goal.
Use the AWS Billing and Cost Management console to view your total monthly spend and the top five services by cost. If you see a spike in costs that you cannot explain, drill down into the service details to find the specific resource causing the increase. Look for services like EC2, RDS, ElastiCache, and Lambda, as these are the most frequent sources of unexpected charges.
Next, use the AWS Cost Explorer to filter costs by the last 30 to 90 days. Set a date range and select a cost type of “Unmatched Credits” or “Forecasted” to see how your spending has trended. If you see a flat or rising line, it is a sign that resources are not being cleaned up.
For a more detailed view of your EC2 instances, use the AWS Resource Groups Tag Editor. This tool allows you to search for resources by tag, name, or type. You can create a query to find all instances that have been stopped for more than 7 days. This is a concrete, actionable filter that helps you identify zombie resources that are still being billed.
- Open the AWS Management Console and navigate to the Cost Explorer.
- Select the Group by dropdown and choose Service.
- Sort the results by Estimated cost in descending order.
- Identify the top three services and note their estimated costs.
- Open each service console to list the active resources.
Find Unused Resources
Once you have a high-level view of your spending, you need to find the specific resources that are no longer needed. AWS organizes resources into logical groups, and you should check each group systematically.
For EC2 instances, start by listing all instances in a region. Look for instances that are stopped or terminated. A stopped instance still incurs charges for its storage and IP address, while a terminated instance should have no associated costs. If you see a stopped instance that you do not recognize, terminate it immediately.
For Elastic Load Balancers (ELB), check for load balancers that have no registered targets. An ALB or NLB that is not routing traffic to any instances is not actively costing money, but it still consumes configuration management overhead. Delete load balancers that have been inactive for more than 30 days.
For Elastic Block Store (EBS) volumes, look for volumes that are available and have no attachments. These are volumes that were created and then detached but not deleted. Detached volumes continue to accrue charges for their storage capacity. Delete any available volume that you do not need for a future project.
For S3 buckets, the process is more complex due to the immutable nature of cloud storage. Start by listing all buckets in the account. Then, for each bucket, review its Bucket Policy and Access Control List (ACL). If a bucket is public, it poses a security risk and should be made private immediately. If a bucket contains no objects and has no lifecycle rules, you can safely delete it.
Remove Orphaned Network Resources
Network resources are the most difficult to track because they are often shared across multiple accounts and regions. An orphaned resource is one that is still in use by another resource, but the resource it is attached to has been deleted.
Check for security groups that have no associated instances. A security group that is not attached to any EC2 instance, Lambda function, or RDS database is not actively protecting any traffic. However, it may still be referenced by a deleted resource. To check, navigate to the VPC console and list all security groups. Then, use the Dependencies tab to see which resources are using the group. If the group is not in use, you can delete it.
Check for Internet gateways and NAT gateways that are not attached to any VPC. An Internet gateway is a regional resource that is attached to a single VPC. If you have deleted the VPC, the Internet gateway should be deleted. Similarly, a NAT gateway is a zone-specific resource that is attached to a single subnet. If you have deleted the subnet, the NAT gateway should be deleted. Leaving these resources attached to deleted VPCs or subnets will not incur charges, but they will clutter your account.
Check for Elastic IPs that are not associated with any running instance. An Elastic IP is a static public IP address that can be reassigned to a different instance. If you have terminated an instance and did not release its Elastic IP, the IP will remain allocated to your account. You must release the IP to stop the associated charges and free up the IP for future use.
- Navigate to the VPC console.
- Select Security Groups from the left menu.
- List all security groups and note their IDs and descriptions.
- For each group, open the Dependencies tab to see which resources use it.
- Delete any security group that has no active dependencies.
Manage Storage and Lifecycle Rules
Storage costs can grow quickly if you are not actively managing the lifecycle of your data. AWS provides Object Lifecycle Management rules to automate the transition and expiration of data.
For S3 buckets, create lifecycle rules to automatically move data to lower-cost storage classes. For example, you can transition data that has not been accessed for 30 days to the Standard-IA (Infrequent Access) class, and data that has not been accessed for 90 days to the Glacier Deep Archive class. These transitions can significantly reduce your storage costs.
For EBS volumes, you can create snapshots and delete snapshots that are older than a certain date. Snapshots are copies of EBS volumes that can be used to restore data or create new instances. However, snapshots also consume storage space and cost money. Set a lifecycle rule to delete snapshots that are older than 90 days to free up space and reduce costs.
- Open the S3 console and select the bucket you want to configure.
- Navigate to the Management tab and click Add lifecycle configuration.
- Create a rule to transition objects to Standard-IA after 30 days.
- Create a rule to transition objects to Glacier Deep Archive after 90 days.
- Create a rule to expire objects after 180 days.
Check for Cost Alerts
Prevention is better than cleanup. You should set up Amazon CloudWatch Alarms to notify you when your spending exceeds a certain threshold.
Go to the CloudWatch console and select Alarms from the left menu. Click Create alarm and choose the Estimated Charges metric. Set the threshold to 80% of your monthly budget and the period to 1 day. This will alert you when you are about to exceed 80% of your budget, giving you time to investigate and stop unexpected spending.
You can also set up alarms for specific services. For example, you can set an alarm on the Estimated Cost for EC2 metric to notify you if your EC2 spending exceeds $50 per day. This will help you identify and terminate instances that are running longer than intended.
Common Mistakes and How to Fix Them
Even with a systematic approach, you can make mistakes that lead to unexpected costs or security risks. Here are the most common mistakes and how to avoid them.
- Mistake: Deleting a console button does not delete the resource. The AWS console is a user interface. When you click the Delete button in the console, you are triggering a command to delete the underlying resource. However, if you do not confirm the deletion, the resource remains. Always confirm the deletion and verify that the resource is gone.
- Mistake: Leaving a stopped instance running. A stopped instance still incurs charges for its storage and IP address. If you are not using an instance, terminate it completely. This will stop all charges associated with the instance.
- Mistake: Forgetting to release Elastic IPs. When you terminate an instance, you must release its Elastic IP to stop the associated charges. If you do not release the IP, it will remain allocated to your account and continue to accrue charges.
- Mistake: Not checking for public S3 buckets. A public S3 bucket can expose your data to the world. If you accidentally make a bucket public, anyone can read or write to it. Always review the bucket policy and ACL to ensure the bucket is private.
How to Verify a Deletion
After you delete a resource, you should verify that it is gone. This ensures that you have not left any orphaned resources behind.
For EC2 instances, navigate to the EC2 console and review the list of instances. If the instance is deleted, it will not appear in the list. For S3 buckets, navigate to the S3 console and review the list of buckets. If the bucket is deleted, it will not appear in the list.
You can also use the AWS CLI to verify deletions. For example, to list all EC2 instances, you can use the command aws ec2 describe-instances. If the instance is deleted, it will not appear in the output.
Related
- Akron Beacon Journal Account Access and Login Help
- How to Prepare a Journal Account: Step-by-Step Guide
- How to Declutter Gmail Account: Steps for a Clean Inbox
General information for everyday wellbeing, not medical advice. If something affects your health, sleep or mood for more than a short while, talk to a qualified professional. Read more
Spotted an error? Tell us and we will correct it (corrections policy).