Created
January 17, 2018 20:53
-
-
Save ssstonebraker/793aac06472912a94f7325d6b51a7ef3 to your computer and use it in GitHub Desktop.
Get all ami's in use on and aws account
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 | |
| # get_amis.sh | |
| # Return a list of all ami's in use in aws | |
| aws ec2 describe-instances --query 'Reservations[*].Instances[*].[ImageId,Tags[*]]' | grep ami | perl -pi -e "s/,//g;" | perl -pi -e "s/\"//g;" | perl -pi -e "s/\s+/\n/g;" | grep -v "^$" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment