travisjeffery / go-ec2-metadata

Go pkg to get metadata about running ec2 instances.

Home Page:https://twitter.com/travisjeffery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


About

Go pkg to get metadata about running ec2 instances.

https://twitter.com/travisjeffery


Languages

Language:Go 100.0%