Last active
February 13, 2020 09:15
-
-
Save posilva/441be9c3564a03b2c10eddcfa228eddb to your computer and use it in GitHub Desktop.
AMI Fetch
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
AMI_FILTER=amzn-ami-hvm-2018.03*-x86_64-ebs | |
for REGION in us-east-1 us-west-2 us-west-1 eu-west-1 eu-central-1 ap-northeast-1 ap-southeast-1 ap-southeast-2 us-east-2 | |
do | |
aws --region $REGION ec2 describe-images --owners amazon \ | |
--filters "Name=name,Values=$AMI_FILTER" \ | |
--query 'sort_by(Images, &CreationDate)[] ' | jq -c 'max_by(.CreationDate) | {region: "'$REGION'", name: .Name, image: .ImageId, date: .CreationDate} ' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added region us-east-2