Deregister Unused AMIs (90+ Days)
AMIs that haven't been used to launch instances in over 90 days still incur EBS snapshot storage charges. This tutorial walks through deregistering an unused AMI and deleting its associated snapshots to eliminate ongoing costs.
Step 1: Navigate to the AMIs Console
Open the EC2 AMIs console in us-east-1. The view is automatically filtered to show AMIs owned by your account.
Step 2: Find the Unused AMI
In the search bar, type remediation-demo-ami to filter for the target AMI. You should see the AMI listed with its creation date confirming it is older than 90 days.
Cloud Custodian flagged this AMI because:
- It was created more than 90 days ago
- No EC2 instances have been launched from it during that period
Step 3: Verify the AMI Is Truly Unused
Select the AMI by clicking its checkbox. In the details panel below, note the AMI ID. Before deregistering, confirm no running instances use this AMI by checking the "AMI ID" column in your EC2 Instances list, or by verifying with the CLI:
aws ec2 describe-instances --filters "Name=image-id,Values=<ami-id>" --query 'Reservations[].Instances[].InstanceId' --region us-east-1
An empty result confirms it is safe to deregister.
Step 4: Note the Associated Snapshots
Click the Storage tab in the details panel. Record the Snapshot ID(s) listed under "Block devices" — you'll need these to delete the snapshots after deregistering the AMI. Deregistering the AMI alone does not delete its snapshots, so you must delete them separately to stop incurring storage charges.
Step 5: Deregister the AMI
With the AMI selected, click the Actions dropdown and choose Deregister AMI.
Step 6: Confirm Deregistration
A confirmation dialog will appear. Review the AMI ID to ensure it matches the target AMI, then click Deregister AMI to confirm.
Note: Deregistration is irreversible. If you may need this AMI again, consider copying it to S3 as a backup first.
Step 7: Delete Associated Snapshots
Now navigate to the EC2 Snapshots console to remove the orphaned snapshots that were backing the AMI.
Step 8: Find the Orphaned Snapshot
Search for the snapshot ID you noted in Step 4. Select it by clicking its checkbox.
Step 9: Delete the Snapshot
Click Actions → Delete snapshot.
Step 10: Confirm Snapshot Deletion
Click Delete in the confirmation dialog. This permanently removes the snapshot and stops all associated EBS storage charges.
Summary
Cost Impact: AMI deregistration itself is free, but the associated EBS snapshots incur storage charges at $0.05/GB-month. Deleting both the AMI and its snapshots eliminates all ongoing storage costs. For a typical AMI backed by a 30 GB snapshot, this saves approximately $1.50/month per AMI.
Alternative Approaches:
- CLI approach:
aws ec2 deregister-image --image-id <ami-id>followed byaws ec2 delete-snapshot --snapshot-id <snap-id>for each associated snapshot. - Lifecycle policy: Use EC2 Image Lifecycle Management or a Cloud Custodian policy with
actions: [deregister]to automatically clean up unused AMIs on a schedule. - Archive instead of delete: If unsure about future need, consider copying the AMI to a cheaper storage tier (e.g., export to S3 Glacier) before deregistering.