Skip to content

Instantly share code, notes, and snippets.

@jmoberly
Created July 9, 2015 19:05
Show Gist options
  • Save jmoberly/e2688bf65479a7152942 to your computer and use it in GitHub Desktop.
Save jmoberly/e2688bf65479a7152942 to your computer and use it in GitHub Desktop.
Getting ID for latest Ubuntu AMI
ubuimagejson=$(curl 'https://cloud-images.ubuntu.com/releases/streams/v1/com.ubuntu.cloud:released:aws.json')
ubuversion=$(echo $ubuimagejson | jq -S '.products | ."com.ubuntu.cloud:server:14.04:amd64" | .versions | keys | .[length-1]')
echo $ubuimagejson | jq -S ".products | .\"com.ubuntu.cloud:server:14.04:amd64\" | .versions.${ubuversion}.items.usee1hs.id"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment