Skip to content

Instantly share code, notes, and snippets.

@goura
Last active May 11, 2016 17:53
Show Gist options
  • Save goura/58017605fde3db049fdb to your computer and use it in GitHub Desktop.
Save goura/58017605fde3db049fdb to your computer and use it in GitHub Desktop.
Get a list of AMI IDs for a specific Ubuntu version
#/bin/sh
curl https://cloud-images.ubuntu.com/locator/ec2/releasesTable | jsonlint -Sf | jq '[.aaData[]|select(.[1]=="trusty" and .[3]=="amd64" and .[4]=="hvm:instance-store")|{region:.[0], ami_id:(.[6]|sub("<a [^<]+>"; "")|sub("</a>"; ""))}]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment