Skip to content

Instantly share code, notes, and snippets.

@philcryer philcryer/
Last active Apr 19, 2017

What would you like to do?
Get the Amazon CoreOS AMI ID and URL
build=alpha # define build ["stable", "beta", "alpha"]
disk=hvm # define disk backing ["pv", "hvm"]
if [ "x$1" = "x" ]; then
echo "Usage: $0 REGION"; exit 1
#### deprecated
#ami_id=$(curl --silent http://$ | grep -A 2 $1 | grep $disk | cut -d"\"" -f4)
#### Source from now (h/t cswong)
ami_id=$(curl --silent$build.json | grep -A 2 "$1" | grep $disk | cut -d"\"" -f4)
[ -z "$ami_id" ] && echo "FAIL: region $1 not found or doesn't include a CoreOS $build, $disk backed AMI" && exit 1
echo -n "$1,$build,$disk,$ami_id,"
echo "$1#launchAmi=$ami_id"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.