delete EBS volume(s) based on EBS volume tag

After detaching EBS volume from AWS instance it is necessary to clean environment to reduce costs and not to leave unused EC2 resources. In case you tag EBS volumes – as I do regularly for easier distinguishing for what are used, then deleting EBS volumes once de-attached from instance is easy task if used simple delete_ebs.py script I am using for this task.

Important: This is destructive operation, it will delete EBS volume in case it is not attached to instance, even if you pass tag of wrong EBS volume. Use carefully and with caution

Usage :

$ python delete_ebs.py --tagname=EBS_TAG

where EBS_TAG is tag of EBS volume you want to delete.

Advertisements

#amazon, #ebs, #ec2, #linux, #python