Created
April 16, 2017 02:54
-
-
Save nmarley/1b6afcabd25c91a892d20c3566dbb051 to your computer and use it in GitHub Desktop.
Query AWS for specific Ubuntu image (AMI-ID), can be run against any 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
#! /bin/bash | |
# get Ubuntu 16.04 AMI for default region | |
aws ec2 describe-images --filters Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170221 | jq -r '.Images[].ImageId' | |
# get same image AMI for ca-central-1 | |
aws --region ca-central-1 ec2 describe-images --filters Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170221 | jq -r '.Images[].ImageId' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment