Skip to content

Instantly share code, notes, and snippets.

@ddgenome
Created August 10, 2016 15:40
Show Gist options
  • Save ddgenome/0e57e325b7a13a7403f7c8f540e8a7a9 to your computer and use it in GitHub Desktop.
Save ddgenome/0e57e325b7a13a7403f7c8f540e8a7a9 to your computer and use it in GitHub Desktop.
Get CoreOS AMI information from AWS
#!/bin/bash
for c in stable beta alpha; do
for ra in $(curl -s "https://coreos.com/dist/aws/aws-$c.json" | jq --raw-output 'del(.release_info) | del(."us-gov-west-1") | map_values(.hvm) | to_entries | .[] | "\(.key):\(.value)"'); do
r=$(echo "$ra" | cut -d : -f 1)
a=$(echo "$ra" | cut -d : -f 2)
echo "$c $r $a"
aws --region "$r" ec2 describe-images --image-id "$a" | jq '.Images[].Name?'
done
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment