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 →
- 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'
- Check load balancers with zero healthy targets or no requests in 30 days (CloudWatch
RequestCount). - Tag candidates with
cleanup-candidate=2026-11-09and post the list to owners for a week. - For volumes, take a final snapshot before deleting; for snapshots, check they aren't backing an AMI that's still in use.
- 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.
More on Cost
The AWS bill jumped 40% this month and finance wants an explanation by tomorrow. How do you find out why?BeginnerThe "NAT Gateway – data processed" line is $9,000 a month. How do you bring it down?IntermediateCut EKS compute cost by 40% without hurting reliability. What's your plan?AdvancedDev and test environments run 24/7 but are used only during office hours. How do you cut that cost?BeginnerCloudWatch Logs costs more than the EC2 fleet. What do you do?IntermediateFinance asks you to buy commitments. Savings Plans or Reserved Instances, and how much?Intermediate