Skip to content

Instantly share code, notes, and snippets.

@Andrei-Pozolotin
Forked from goura/ubuntu_ami_ids.sh
Created May 11, 2016 17:53
Show Gist options
  • Save Andrei-Pozolotin/b0fdb0eea399d2cb33ea67f8247ae60f to your computer and use it in GitHub Desktop.
Save Andrei-Pozolotin/b0fdb0eea399d2cb33ea67f8247ae60f 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