Even after the associated EC2 instances stop running, unused EBS Volumes may continue to incur expenses. It is recommended to consider deleting non-used EBS volumes to reduce your monthly AWS bill.
Note: This will show you all unattached EBS volumes across all accounts and all regions.
Note: You’ll have to repeat the below steps for each account and region.
1. Login to your AWS Management Console and navigate to the EC2 dashboard.
2. From the left-hand menu, select 'Volumes' under the 'Elastic Block Store' section.
3. This will display a list of all the volumes in your account. Search for any volumes that have the "available" status, which means they are unattached.
4. Volumes that have an available state means that they are currently unused (unattached) by any instance.
1. Run the describe-volumes command, to list all the unused EBS volumes in your cloud environment:
2. Configure data for each detected unused EBS volume should be returned as output:
1. Open your preferred terminal or command prompt and ensure that you are logged in to your AWS account with the appropriate credentials.
2. Use the following command to list all the available volumes in your account:
3. The output of the above command will show all the volumes in your account. Look for the volumes that are in the "available" state and have no "Attachments" associated with them. Note down the "VolumeId" of the unattached volumes you want to delete.
4. Use the following command to delete the unattached volumes. Replace the "VolumeId" parameter with the actual ID of the volume you want to delete.
5. Repeat the above step for all the unattached volumes you want to delete.
6. Once you have deleted all the unattached volumes, you can use the following command to confirm that the volumes are no longer in your account:
7. The output of the above command should not show the volumes you have just deleted.
That's it! You have successfully deleted the unattached volumes from your AWS account using the command line interface.