You suspect there are hundreds of orphaned resources: unattached EBS volumes, old snapshots, idle load balancers, unused Elastic IPs. How do you clean up safely?

BeginnerScenarioCost
Answer

Situation read → Orphans cost money every month, but deleting the wrong snapshot can be unrecoverable. Find, tag, wait, then delete.

What I'd do →

  1. Find them:
aws ec2 describe-volumes --filters Name=status,Values=available \
  --query 'Volumes[].{ID:VolumeId,GB:Size,Created:CreateTime}' --output table
aws ec2 describe-addresses --query 'Addresses[?AssociationId==null].PublicIp'
  1. Check load balancers with zero healthy targets or no requests in 30 days (CloudWatch RequestCount).
  2. Tag candidates with cleanup-candidate=2026-11-09 and post the list to owners for a week.
  3. For volumes, take a final snapshot before deleting; for snapshots, check they aren't backing an AMI that's still in use.
  4. Automate: AWS Trusted Advisor or a scheduled script, plus Terraform-only creation so new orphans are rare.

Why → The tag-and-wait step catches the "we still need that" cases before they become incidents.

Interview tip → Note that public IPv4 addresses are charged hourly whether attached or not; that changed in 2024.

All Real-World Interview questions Roadmap: Interview readiness

More on Cost