Created
June 27, 2019 23:03
-
-
Save akloya/06016cbff387f89ba5571f1844273d9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# scripts delete all the ebs volumes that are in available state | |
import boto3 | |
ec2 = boto3.client("ec2") | |
response = ec2.describe_volumes( | |
Filters=[ | |
{ | |
'Name': 'status', | |
'Values': [ | |
'available', | |
] | |
}, | |
] | |
) | |
for volume in response['Volumes']: | |
print("Deleting Volume: " + volume['VolumeId']) | |
response = ec2.delete_volume( | |
VolumeId=volume['VolumeId'] | |
) |
python. file name ends with .py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
which programming language is this