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 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 --tagname=EBS_TAG

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

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