Created
June 18, 2018 17:54
-
-
Save khous/3be993c2a8cbf767d28c4def21c7f2aa to your computer and use it in GitHub Desktop.
Enumerate public AMIs per region
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
#!/usr/bin/env bash | |
echo "Searching for image where name begins with $1" | |
regions=$(aws ec2 describe-regions --output text --query 'Regions[*].RegionName') | |
for region in $regions; do | |
( | |
echo "$region $( aws ec2 describe-images --region $region --filters Name=is-public,Values=true Name=name,Values="$1*" | grep ImageId )" | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment