Skip to content

Instantly share code, notes, and snippets.

@divideby0
Last active August 11, 2016 15:30
Show Gist options
  • Save divideby0/25362ed0f8c6771f33ea41103138cf43 to your computer and use it in GitHub Desktop.
Save divideby0/25362ed0f8c6771f33ea41103138cf43 to your computer and use it in GitHub Desktop.
REGION=${REGION:-us-east-1}
UBUNTU_RELEASE=${UBUNTU_RELEASE:-trusty}
ARCH=${ARCH:-amd64}
INSTANCE_TYPE=${INSTANCE_TYPE:-hvm:ebs}
curl 'https://cloud-images.ubuntu.com/locator/ec2/releasesTable' --compressed | grep -Ei "\"$REGION\",\"$UBUNTU_RELEASE\",.*,\"$INSTANCE_TYPE\"" | grep -oEi "ami-\w+" | head -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment