hashicorp / go-discover

Discover nodes in cloud environments
Mozilla Public License 2.0
563 stars 123 forks source link

Use ec2-metadata region endpoint instead of ec2instanceidentity #191

Open jhmartin opened 2 years ago

jhmartin commented 2 years ago

https://github.com/hashicorp/go-discover/blob/master/provider/aws/aws_discover.go#L71-L79 determines the instance region based on the Ec2InstanceIdentityDocument. AWS now offers this as a standalone metadata field. It would be less confusing to fetch the standalone field vs decoding it out of the instance id document.

See: