Skip to content

Instantly share code, notes, and snippets.

@bakins
Last active August 29, 2015 14:19
Show Gist options
  • Save bakins/eb9893bdda9dd138d7bb to your computer and use it in GitHub Desktop.
Save bakins/eb9893bdda9dd138d7bb to your computer and use it in GitHub Desktop.
Get CoreOS AMI for an AWS region
function cores-image {
REGION=$1
CHANNEL=${2:-alpha}
EXPRESSION=`printf '.amis|map(select(.name == "%s"))[0]["hvm"]' "$REGION"`
curl --fail -s -L http://$CHANNEL.release.core-os.net/amd64-usr/current/coreos_production_ami_all.json | jq -r "$EXPRESSION"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment