Created
November 4, 2015 06:22
-
-
Save jorke/f1bf871760028a7c1caa to your computer and use it in GitHub Desktop.
delete ec2 resources
This file contains hidden or 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
#!/bin/bash | |
for s in $(aws ec2 describe-snapshots --owner-id self --output text | egrep SNAPSHOTS | cut -f6 -d$'\t'); do aws ec2 delete-snapshot --snapshot-id $s; done; | |
for i in $(aws ec2 describe-images --owners self --output text | egrep IMAGES | cut -f6 -d$'\t'); do aws ec2 deregister-image --image-id $i; done; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment