Skip to main content

🛡️ AWS EC2 Image is unused🟢

Logic

Similar Policies

Description

Open File

Description

This policy identifies Amazon Machine Images (AMIs) that appear to be unused. An AMI is considered unused when all of the following conditions are met:

  1. The AMI is in the Available state.
  2. The AMI was created more than 90 days ago.
  3. The AMI was last used more than 90 days ago.
  4. The AMI is not associated with any AWS EC2 Instances in the CMDB.

Removing unused AMIs helps reduce unnecessary storage costs. The AMI cleanup process consists of two steps: deregistering the unused AMI and deleting the associated snapshots.

Rationale

AMIs stored in your AWS account incur ongoing storage charges, regardless of whether they are actively used. Over time, AMIs created from previous deployments, testing, or backup processes can accumulate. If an AMI is no longer required for launching instances, compliance, or recovery purposes, retaining it results in unnecessary cost and operational overhead.

Audit

This policy flags an AWS EC2 Image as INCOMPLIANT if all of the following conditions are met:

... see more

Remediation

Open File

Remediation

Remove Unused AMIs

To clean up unused Amazon Machine Images (AMIs), deregister the image and delete any associated snapshots.

From Command Line

Run the following command to deregister an unused AMI and delete its associated snapshots:

aws ec2 deregister-image \
--region {{us-east-1}} \
--image-id {{image-id}} \
--delete-associated-snapshots # If a snapshot is associated with multiple AMIs, it is not deleted, regardless of this setting.

Repeat this process for all unused AMIs identified in your AWS account.

policy.yaml

Open File

Linked Framework Sections

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
💼 Cloudaware Framework → 💼 Waste Reduction28no data