Created
October 17, 2017 08:56
-
-
Save PauloMigAlmeida/b3b250445798788314bf469f55bdb75b to your computer and use it in GitHub Desktop.
List latest Amazon Linux AMIs in every AWS 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
for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output json | jq -r '.[]'); do | |
echo "$region = $(aws ec2 describe-images --owners amazon --filters 'Name=name,Values=amzn-ami-hvm-????.??.?.x86_64-gp2' --query 'sort_by(Images, &CreationDate) | [-1].ImageId' --region $region)" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment