How to Find and Delete Unattached AWS Resources
Managing your AWS resources is critical to making sure that you aren't wasting money. Here are the steps you can take to ensure that your team is keeping costs down.
Managing your AWS resources is critical to making sure that you aren't wasting money. Here are the steps you can take to ensure that your team is keeping costs down.
If you're using AWS without regularly checking for and removing unattached AWS resources, you may be incurring unnecessary costs. Amazon charges based on the entire pool of resources you have access to, not just based on which resources are actively in use. Performing periodic checks on your resources during and after development is essential to good AWS hygiene and can help lower overhead.
The three resources most likely to be overlooked are EBS volumes, ENIs, and NAT gateways. Here are three quick checks you can perform to ensure you're not swimming in excess resources, along with instructions on removing any extra resources you may uncover while performing these checks.
It’s important to note that you’ll need to run each check for as many regions as you are running in or have run resources in. Ok, let’s dive in.
Unattached AWS resources often take the form of EBS volumes. To find and remove any unattached EBS volumes, here are the seven steps to follow:
Note that it is not possible to delete an attached volume. If your AWS services are running as expected and it's possible to delete a volume, that volume likely should be deleted.
Here are the ten steps to manually find and release any unattached ENIs.
Note that if these commands successfully release an ENI, no output is returned.
Here are the eleven steps to manually find and remove any unused NAT gateways and release any Elastic IPs associated with them.
Alternatively, you can release the EIP through the command line. There are four different ways to release an elastic IP address using the command line, depending on your setup. If you're using AWS CLI and EC2-Classic, open your terminal and use the command:
If you're using AWS CLI and EC2-VPC, use:
If you're using AWS Tools for Windows PowerShell and EPC-Classic, open PowerShell and use the command:
If you're using AWS Tools for Windows PowerShell and EPC-VPC, open PowerShell and use the command:
If you run resources in multiple regions, then running each of these checks multiple times on a regular basis might seem impractical or inefficient. When you create a free Blink account, you can schedule these resource checks using pre-built automations. Check multiple regions and multiple resource types in a few clicks.
Create your free Blink account and start automating your AWS resource checks today.
Transform your security and platform operations today with 5000+ no-code automations.