Skip to content

Instantly share code, notes, and snippets.

@ChengLong
Created September 10, 2013 06:56
Show Gist options
  • Save ChengLong/6505860 to your computer and use it in GitHub Desktop.
Save ChengLong/6505860 to your computer and use it in GitHub Desktop.
Find IP of EC2 instance

To find IP of an EC2 instance

ssh to the instance, run curl http://169.254.169.254/latest/meta-data/public-ipv4

To find hostname of an EC2 instance

ssh to the instance, run curl http://169.254.169.254/latest/meta-data/public-hostname

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment