diff options
Diffstat (limited to 'aws')
| -rw-r--r-- | aws/ec2meta.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/aws/ec2meta.go b/aws/ec2meta.go index 0e5cba64..cc3766b7 100644 --- a/aws/ec2meta.go +++ b/aws/ec2meta.go @@ -7,10 +7,12 @@ import ( "net/http" "strings" "time" + + "github.com/hairyhenderson/gomplate/env" ) // DefaultEndpoint - -const DefaultEndpoint = "http://169.254.169.254" +var DefaultEndpoint = "http://169.254.169.254" // Ec2Meta - type Ec2Meta struct { @@ -23,6 +25,10 @@ type Ec2Meta struct { // NewEc2Meta - func NewEc2Meta(options ClientOptions) *Ec2Meta { + if endpoint := env.Getenv("AWS_META_ENDPOINT"); endpoint != "" { + DefaultEndpoint = endpoint + } + return &Ec2Meta{cache: make(map[string]string), options: options} } |
