Skip to content

Instantly share code, notes, and snippets.

@algotrader-dotcom
Created October 14, 2015 04:25
Show Gist options
  • Select an option

  • Save algotrader-dotcom/068ff350c5a0c75dec1d to your computer and use it in GitHub Desktop.

Select an option

Save algotrader-dotcom/068ff350c5a0c75dec1d to your computer and use it in GitHub Desktop.
AWS EC2 Instance Metadata
There is an easy way to access to Instance information from within
# Obtaining the Instance ID:
wget -q -O - http://169.254.169.254/latest/meta-data/instance-id
i-87eef4e2
# Public Hostname:
wget -q -O - http://169.254.169.254/latest/meta-data/public-hostname
ec2-50-17-85-234.compute-1.amazonaws.com
# Public IPv4 Address:
wget -q -O - http://169.254.169.254/latest/meta-data/public-ipv4
50.17.85.234
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment