Skip to content

Instantly share code, notes, and snippets.

@tsellers-r7
Created January 12, 2018 16:33
Show Gist options
  • Save tsellers-r7/002b75391a3384326587714561ed8820 to your computer and use it in GitHub Desktop.
Save tsellers-r7/002b75391a3384326587714561ed8820 to your computer and use it in GitHub Desktop.
Searching Amazon AMIs for the latest hvm-ssd images for Ubuntu 16.04
aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' --region us-east-1 | while read region; do echo -e "$region "; aws --region $region ec2 describe-images --owners 099720109477 --filters Name=root-device-type,Values=ebs Name=architecture,Values=x86_64 Name=name,Values='*hvm-ssd/ubuntu-xenial-16.04*' --query 'sort_by(Images, &Name)[-1].ImageLocation'; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment