I need to remove a couple of EC2 instances and check for related volumes, IPs and security groups. The account is managed through the console rather than infrastructure as code. Is there a tool that can report what to check without deleting anything automatically?
How can I find resources left behind when deleting EC2 instances?
Answers
For just two instances, start in the EC2 console. The instance Storage and Networking tabs show attached volumes, network interfaces and security groups. Make a list before terminating anything.
Check each volume's delete-on-termination setting rather than assuming it will be removed. Also check for Elastic IPs that may be left unassociated. Both can remain as cleanup and billing items. A security group may be shared, so check what else uses it before deleting it.
Reply to this answer
AWS Resource Explorer is a good place to search for resources across the account. The resource groups view and Tag Editor are useful for a manual audit too, especially if your resources have consistent tags or names.
Check the relevant regions and use the results as a second look, not proof that every resource found belongs exclusively to those instances.
Reply to this answer
If AWS Config is already enabled, take a look there for another view of the resources. For a broader picture, discovery and diagramming tools such as Former2, Cloudcraft or Lucidscale may help you trace connections.
I'd still manually follow the networking and security group relationships before removing anything. A diagram is a starting point, not a deletion plan.
Reply to this answer
Cost Explorer grouped by service can help prioritize the expensive parts of the account, but it won't show every resource you need to audit. Free resources can be missed, including things like IAM and security groups, so pair it with a resource search.
Reply to this answer
CloudFormation IaC Generator is another option to investigate if you want a template describing existing resources. Check what it actually captures before relying on it to map dependencies. It doesn't require you to hand over deletion decisions to a cleanup tool.
Reply to this answer
Add your answer
Answers are reviewed before publication.
m6!clamp_417:
And don't assume an RDS instance is disposable just because one of the EC2 instances connects to it. Check whether anything else depends on it first.