AWS Builder Center
Your AWS Lab Is Not Finished Until You Clean It Up

Your AWS Lab Is Not Finished Until You Clean It Up

Building something on AWS is only half the job. Learn how to identify forgotten resources, control cloud costs, and create a simple cleanup routine that keeps development environments organized and secure.

Your AWS Lab Is Not Finished Until You Clean It Up

There is a moment in almost every cloud project when everything finally works.
Your EC2 instance is running. Your application is accessible. Your Lambda function returns the expected response, and the architecture looks exactly as you planned.
You take a screenshot, update your project notes, and move on to the next task.
But there is one small problem: the infrastructure is still running.
That forgotten instance, unattached storage volume, public IP address, or test database may continue consuming resources long after you have stopped working on the project.
Building something on AWS is only half the job. Knowing what to keep, what to delete, and how to verify the cleanup is part of building responsibly.

How cloud resources get forgotten

AWS makes it relatively easy to create resources. You can launch an EC2 instance, create an S3 bucket, configure a database, or deploy a serverless application in a short amount of time.
The problem usually appears later.
You create one resource to test an idea, another to troubleshoot an error, and a third to compare configurations. Once the experiment is over, remembering every resource becomes difficult.
A typical development account might contain:
  • EC2 instances created for temporary experiments.
  • EBS volumes left behind after instances are terminated.
  • Elastic IP addresses that are no longer needed.
  • RDS databases created for testing.
  • Load balancers from abandoned deployments.
  • S3 objects, snapshots, and old build artifacts.
  • Lambda functions and supporting resources from previous experiments.
Not every resource generates a charge simply because it exists. The cost depends on the service, configuration, usage, and applicable pricing. However, several resources can continue generating charges even when nobody is actively using the application.
This is why cleaning up a cloud environment deserves the same attention as creating it.

Start with a resource inventory

Before deleting anything, find out what exists.
The AWS Management Console is a useful starting point, especially when learning a new service. For a broader view, AWS Cost Explorer can help you understand spending by service, while AWS Billing and Cost Management provides access to billing information and cost-management tools.
AWS Resource Explorer can also help discover resources across supported services and regions.
A useful first check is to review:
1. Compute resources
Look for EC2 instances, Auto Scaling groups, and other compute resources that were created for completed experiments.
2. Storage resources
Check for unattached EBS volumes, old snapshots, unused S3 objects, and temporary files.
3. Networking resources
Review Elastic IP addresses, load balancers, NAT gateways, and other networking components that may still be active.
4. Databases
Check whether test databases and their associated storage, backups, or snapshots are still required.
5. Serverless resources
Review API Gateway APIs, Lambda functions, queues, event rules, and supporting resources that belong to completed projects.
One important detail: AWS resources are not always visible from a single regional console view. Review the relevant regions and services, and use account-wide discovery tools where appropriate.

A simple cleanup workflow

You do not need an elaborate automation system to get started. A consistent process is often enough.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Finish the Experiment
|
v
Identify Created Resources
|
v
Check Ownership and Dependencies
|
v
Keep, Archive, or Delete
|
v
Verify Remaining Resources
|
v
Review Costs and Budgets

Step 1: Identify what belongs to the project

Use resource names, tags, deployment outputs, and infrastructure-as-code files to determine which resources were created for the experiment.
For example, a project might use a naming convention such as:
lab-week4-test-api
Consistent naming makes it easier to distinguish temporary resources from production infrastructure.

Step 2: Check dependencies before deleting

Never assume a resource is unused simply because its name looks old.
An EBS volume may contain important data. An S3 bucket may hold application files. A security group may still be attached to another resource.
Before deletion, verify ownership, dependencies, and whether the data needs to be retained.
For databases and storage, create an appropriate backup when necessary.

Step 3: Delete in a sensible order

Remove resources according to their dependencies.
For example, an application might require its API configuration and compute resources to be removed before certain supporting components can be safely deleted.
Follow the service's deletion process and check for retained data, snapshots, and other resources that may remain afterward.

Step 4: Verify the result

A successful deletion message does not always mean the entire environment has been removed.
Check the relevant service consoles again. Review remaining resources, associated storage, and the account's cost information.
This final verification is an important part of the workflow.

Make cleanup easier with tags

One of the simplest improvements is to tag resources when you create them.
For example:
Tag keyExample value
ProjectStudentPortal
EnvironmentDevelopment
OwnerDevelopmentTeam
PurposeTemporaryLab
ExpiryDate2026-10-20
These values are examples, not a universal tagging standard.
Tags help identify the purpose and ownership of resources. They can also support cost allocation and automated cleanup workflows when the relevant services and tools are configured appropriately.
An expiry-date tag does not automatically delete a resource. You need an automation or operational process that reads the tag, verifies the resource is eligible for removal, and performs the required action.
For shared accounts, consider requiring an owner and project identifier for resources created by development teams.

Use AWS Budgets before problems appear

Cost monitoring should begin before an unexpected bill arrives.
AWS Budgets allows you to establish spending or usage thresholds and configure notifications. AWS Cost Anomaly Detection can help identify unusual spending patterns.
For a development environment, consider setting:
  • A monthly cost budget.
  • Notifications when spending reaches defined thresholds.
  • Alerts for unexpected changes in service costs.
  • A regular review of services contributing to spending.
Remember that a budget alert is not automatically a spending cap. Notifications can arrive after costs have already been incurred, and automated budget actions require additional configuration.
For this reason, cost alerts and resource cleanup should work together rather than replacing each other.

Can cleanup be automated?

Yes, but automation should come after you understand the resources and their dependencies.
A basic cleanup system could identify resources with an expiry tag, notify the owner, and prepare a list of resources eligible for deletion.
A more advanced workflow could use scheduled AWS Lambda functions, EventBridge, and supported AWS APIs to perform checks automatically.
For example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Scheduled Event
|
v
AWS Lambda
|
v
Find Expired Resources
|
v
Check Ownership and Rules
|
v
Notify Owner
|
v
Approve and Delete
|
v
Record the Result
The approval step is important. Automatically deleting resources based only on their age or a tag can destroy useful data or interrupt an active application.
A safer implementation should exclude protected resources, verify dependencies, record every action, and use least-privilege IAM permissions.
For shared or production environments, begin with reporting and notifications before enabling automatic deletion.

A habit worth building

For every new AWS experiment, follow three simple rules.
Before starting: Know which resources you intend to create and what they may cost.
While working: Use consistent names and tags so you can identify your resources later.
After finishing: Remove what is no longer needed, verify the result, and review the cost impact.
For longer-running projects, schedule a recurring resource review rather than waiting until the end.
These habits are useful whether you are completing a cloud lab, building a portfolio project, testing a new architecture, or managing a production environment.

Final thoughts

Cloud engineering is not just about making an application work. It also involves understanding the resources behind it and taking responsibility for their lifecycle.
A clean AWS environment is easier to understand, easier to troubleshoot, and less likely to accumulate unnecessary costs. More importantly, a cleanup routine helps developers develop better habits before their projects become larger and more complex.
The next time you finish an AWS experiment, do not stop when the application works.
Check what you created, protect what matters, remove what you no longer need, and verify that the environment is clean.
A good cloud project does not just start well. It finishes responsibly.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article