Go pkg to get metadata about running ec2 instances.
Go
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.travis.yml
README.md
ec2_metadata.go
ec2_metadata_test.go

README.md

Travis CI

ec2-metadata

Get metadata about your running instance.

Even works when ran inside a Docker container.

  • Instance ID

    instanceID, err := ec2metadata.InstanceID()
    # => "i-4c3dc25a", nil
  • Local IP address

    localIP, err := ec2metadata.LocalIPAddress()
    # => "10.0.0.1", nil
  • Public IP address

    publicIP, err := ec2metadata.PublicIPAddress()
    # => "72.0.0.0", nil

License

MIT