Skip to content

Instantly share code, notes, and snippets.

@akloya
Created June 27, 2019 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save akloya/06016cbff387f89ba5571f1844273d9c to your computer and use it in GitHub Desktop.
Save akloya/06016cbff387f89ba5571f1844273d9c to your computer and use it in GitHub Desktop.
# 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']
)
@drixoneops
Copy link

which programming language is this

@akloya
Copy link
Author

akloya commented Nov 11, 2020

python. file name ends with .py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment