Created
July 4, 2018 11:56
-
-
Save daniyel/9109817b07deea29faaf8fc59ef1484c to your computer and use it in GitHub Desktop.
Get a list of AMI images for CloudFormation use.
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
#!/bin/bash -xe | |
REGIONS=$(aws ec2 describe-regions --query "Regions[].RegionName" --output text) | |
for region in $REGIONS; do | |
ami=$(aws --region $region ec2 describe-images --filters "Name=name,Values=amzn-ami-hvm-2018.03.0.20180508-x86_64-gp2" --query "Images[0].ImageId" --output "text") | |
printf "$region:\n AMI: '$ami'\n" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment