Skip to content

Instantly share code, notes, and snippets.

@kanatzidis
Created January 2, 2017 12:39
Show Gist options
  • Save kanatzidis/6f62ab0ad2840208bfade605a282c5ae to your computer and use it in GitHub Desktop.
Save kanatzidis/6f62ab0ad2840208bfade605a282c5ae to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# set env vars from within ec2 instance
EC2_AVAIL_ZONE=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
EC2_REGION="`echo \"$EC2_AVAIL_ZONE\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment