Cost Optimization: How to Identify and Clean Up Unused AMIs and EBS Volumes in AWS

AWS Cost Optimization
Written by
Published on
March 20, 2025

In the world of cloud computing, it's easy to provision resources quickly, but it's just as easy to forget about them once they're no longer needed. This "set it and forget it" approach leads to significant waste and unnecessary costs.

For AWS users, two of the biggest culprits for unexpected charges are unused Elastic Block Store (EBS) volumes and Amazon Machine Images (AMIs) . In this comprehensive guide, we'll explore how to identify these resources, understand their cost impact, and implement best practices for cleaning them up—both manually and through automation.

1. Understanding the Cost Impact of Unused Resources

AWS Cost Optimization

EBS Volumes: The Silent Cost Accumulator

EBS volumes remain provisioned and continue to incur costs even after an EC2 instance is stopped or terminated. While the cost of a single unused volume might seem negligible (approximately $4/month per volume), the financial impact becomes substantial when hundreds or thousands of volumes are left unused across an organization.

Consider this scenario: A company with 500 unused 100GB gp3 volumes is essentially wasting $2,000 monthly—or $24,000 annually —on storage that serves no purpose.

AMIs: Hidden Costs in Your Snapshots

AMIs are snapshots of EC2 instance root disks that organizations create for various purposes:

  • System backups
  • CI/CD pipeline artifacts
  • Environment replication
  • Version control

Unlike incremental EBS snapshots, AMIs are billed as full snapshots, making them particularly expensive when left unused. Research shows that transitioning unused AMIs to archived snapshots can reduce costs by up to 75% .

2. Best Practices for Cleaning Up Unused EBS Volumes

Identification and Manual Cleanup

EBS Volume Costs

How to Identify Unattached Volumes:

  • Using the AWS Management Console:
    • Navigate to EC2 > Volumes
    • Filter by "State" and select "available" (this shows volumes not attached to instances)
    • Review the list, paying special attention to volumes that have been unattached for more than 30 days
  • Using AWS CLI:
    • aws ec2 describe-volumes --filters Name=status,Values=available

Snapshot Before Deletion:

Before removing any volume, it's advisable to create a snapshot as a safety measure:

  1. Select the unattached volume
  2. Choose "Actions" > "Create snapshot"
  3. After verifying the snapshot is complete, delete the original volume

Remember that while snapshots are cheaper than volumes (approximately $0.05/GiB/month vs. $0.08/GiB/month for gp3 volumes), they still incur costs and should be managed carefully.

Rightsizing and Volume Type Optimization

Volume Rightsizing Strategy:

  • Monitor your existing volumes with CloudWatch and Trusted Advisor to identify:
    • Overprovisioned volumes (low utilization)
    • Volumes using older, more expensive types (e.g., gp2 instead of gp3)
  • Actions to take:
    • Resize volumes based on actual usage patterns
    • Migrate from gp2 to gp3 for cost savings with comparable performance
    • Consider moving rarely accessed data to cheaper storage tiers

Tagging Strategy:

Implement a robust tagging system that includes:

  • Environment (production, development, testing)
  • Owner/team
  • Project/application
  • Expected lifetime
  • Scheduled review date

This approach simplifies identification during cleanup audits and enables automated governance.

Automation via Lifecycle Policies

Reduce manual effort through automation:

  • Implement Amazon Data Lifecycle Manager (DLM) policies
  • Create custom scripts using AWS Lambda and CloudWatch Events
  • Utilize Systems Manager OpsCenter for lifecycle management

Example Lambda function approach:

  • Schedule a CloudWatch Event to trigger daily
  • Lambda function identifies unattached volumes older than 30 days
  • Function creates snapshots and tags them appropriately
  • After snapshot verification, function deletes the original volumes

3. Managing Unused AMIs

Understanding AMI Accumulation

Identifying Unattached EBS Volumes

Purpose and Proliferation:

AMIs accumulate rapidly in organizations with:

  • Frequent deployment cycles
  • Multiple environments
  • CI/CD pipelines that create AMIs as build artifacts
  • Backup strategies that leverage AMIs

Determining Usage:

An AMI is typically considered "unused" if no instance has been launched from it in the past 31 days. To determine this:

Using AWS CLI:

# List all of your AMIs
aws ec2 describe-images --owners self

# Check if an AMI is being used by any running instances
aws ec2 describe-instances --filters "Name=image-id,Values=ami-0123456789example"

Cleanup Process for AMIs

The Three-Step Approach:

  1. Identify Unused AMIs:
    • Check last launched date
    • Verify no current instances use the AMI
    • Confirm the AMI isn't referenced in Launch Templates or Auto Scaling Groups
  2. Deregister the AMI:
    aws ec2 deregister-image --image-id ami-0123456789example
  3. Archive the Underlying Snapshot: Instead of deleting the snapshot completely (which would remove your ability to recover the AMI if needed), archive it:
    aws ec2 modify-snapshot-tier --snapshot-id snap-0123456789example --storage-tier archive

    This approach reduces storage costs by approximately 75% while maintaining recoverability.

Leverage Recycle Bin and Retention Policies:

Configure the EBS Recycle Bin to retain deleted snapshots:

  1. Navigate to EC2 > Recycle Bin
  2. Create a retention rule
  3. Set a retention period (typically 15-31 days)

This provides a safety net against accidental deletions or hasty cleanup efforts.

4. Ongoing Monitoring and Governance

AMI Cleanup Process

Regular Audits:

Implement a cadence of resource reviews:

  • Weekly automated scans for quick wins
  • Monthly detailed reviews with team stakeholders
  • Quarterly comprehensive cost optimization sessions

Utilize AWS Cost Explorer and AWS Budgets to:

  • Track spending trends
  • Set alerts for unexpected increases
  • Identify resource categories consuming disproportionate budget

Reporting and Accountability:

Create dashboards that show:

  • Current unused resource count and cost
  • Historical trends in resource utilization
  • Cost savings from cleanup efforts
  • Team/department breakdown of resource usage

5. Conclusion

Effectively managing unused AMIs and EBS volumes represents a significant opportunity for immediate AWS cost reduction. By implementing the strategies outlined in this guide:

  • Identification and deletion of unused resources
  • Automation of lifecycle management
  • Rightsizing and storage type optimization
  • Implementation of robust tagging and governance

Organizations can achieve substantial cost savings while maintaining operational efficiency. The combination of automated tools and vigilant governance ensures that cloud costs remain predictable and optimized over the long term.

"Our AWS cost optimization efforts focusing on unused EBS volumes and AMIs resulted in a 27% reduction in monthly storage costs, saving over $15,000 annually for our mid-sized organization."

Michael Rodriguez, Cloud Infrastructure Manager

This comprehensive approach not only saves money but also simplifies infrastructure management and enhances overall cloud hygiene—making your AWS environment more manageable, cost-effective, and sustainable.

Taking Action Today

Ready to start optimizing your AWS costs? Here are four steps to begin your journey:

  1. Run an initial audit to identify unattached EBS volumes and unused AMIs
  2. Implement proper tagging for all resources to track ownership and purpose
  3. Set up basic automation for identifying and flagging wasteful resources
  4. Schedule regular reviews of your AWS environment to maintain optimization

By taking these steps, you'll be well on your way to a more efficient and cost-effective AWS infrastructure.

Optimize Your Cloud Spend – Request a Customized Savings Analysis Today

Take the first step towards transforming your cloud cost management with SKYXOPS.

Get a detailed, tailored analysis to identify hidden savings and eliminate unnecessary cloud spend.

  • Identify Hidden Savings Opportunities
  • Eliminate Wastage and Optimize Resources
  • Seamless Onboarding & Setup
  • Free 1-Month Access – No Obligation
Please enter your first name.
Please enter your last name.
Please enter your company name.

Click "Send" to receive your complimentary analysis and start maximizing your cloud savings!