aws-ec2-ami-cleanup-inventory

Builds read-only AWS EC2, EBS, AMI, and snapshot cleanup inventories across accounts.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/amitkarpe/agent-skills --skill aws-ec2-ami-cleanup-inventory-amitkarpe
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: aws-ec2-ami-cleanup-inventory
Source: https://github.com/amitkarpe/agent-skills/tree/main/skills/aws-ec2-ami-cleanup-inventory
Command: npx skills add https://github.com/amitkarpe/agent-skills --skill aws-ec2-ami-cleanup-inventory-amitkarpe

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deciding which AWS EC2 instances, EBS volumes, AMIs, and snapshots are safe to delete is risky without evidence. This Skill produces a read-only, classified inventory across one or more AWS profiles/accounts so cleanup decisions are based on data, not guesswork, before any termination, deletion, or deregistration happens. ## Core Features & Use Cases - Read-only multi-account inventory: Collects EC2, EBS volume, AMI, and snapshot data per profile/region using AWS CLI describe calls, saving raw JSON evidence under a timestamped directory. - Safety classification: Sorts resources into buckets like cleanup-candidate, cleanup-after-scan, needs-owner-confirmation, and retain-protected, checking TTLs, SSM pointers, launch templates, AMI-to-snapshot mappings, and sharing permissions. - Structured RESULT.md output: Produces DEV/PROD-separated review tables with cleanup candidates first, confidence and reasons, rough cost notes, and the exact approvals needed. - Use Case: Before retiring expired AMI Factory validation resources, run this Skill to list which DEV and PROD EC2s, volumes, AMIs, and snapshots are cleanup candidates versus protected, then hand the approved list to terraform-terragrunt-cleanup or the owning repo command. ## Quick Start Ask the agent to build a read-only cleanup inventory of EC2 instances, EBS volumes, AMIs, and snapshots across your DEV and PROD AWS profiles and show the cleanup candidate tables.

Frequently Asked Questions about aws-ec2-ami-cleanup-inventory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find which AWS EC2 instances and EBS volumes can be safely deleted?▼

Run a read-only inventory that collects describe-instances, describe-volumes, describe-images, and describe-snapshots output per account and region. Resources are then classified by TTL, tags, attachments, and references into cleanup candidates versus protected resources before any deletion.

How to identify unused AMIs and EBS snapshots for cleanup?▼

List AMIs with describe-images --owners self and snapshots with describe-snapshots --owner-ids self, then check EC2 references, launch template defaults, AMI-to-snapshot block device mappings, and sharing permissions. Only resources with no references and expired TTLs become cleanup candidates.

Does this cleanup inventory delete or modify any AWS resources?▼

No, the inventory is strictly read-only and never stops, terminates, deletes, or deregisters anything. Actual cleanup execution is delegated to the owning Terraform/Terragrunt stack command or a repo-owned cleanup command after explicit approval.

Can an expired TTL tag alone mark an EC2 instance as safe to delete?▼

No, an expired TTL is not sufficient evidence for deletion. The resource must also be checked for SSM pointer references, attached EBS volumes, launch template usage, AMI sharing, and unclear ownership before being classified as a cleanup candidate.

What happens to shared IAM roles and policies during cleanup review?▼

Shared IAM roles and policies are retained by default and classified as retain-shared-iam. They are only considered for deletion when the request includes explicit approval and confirmed ownership, since they often support zero-cost shared validation paths.