Created
October 31, 2015 17:05
-
-
Save dblooman/bb4293ef6b9d162a20ed to your computer and use it in GitHub Desktop.
ELB Cleanup script
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
| require 'json' | |
| response = `aws ec2 describe-volumes --region eu-west-1` | |
| parsed_response = JSON.parse response | |
| parsed_response["Volumes"].each do |vol| | |
| if vol["State"] == "available" | |
| `aws ec2 delete-volume --volume-id #{vol["VolumeId"]} --region eu-west-1` | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment