diff --git a/discovery/ec2/ec2.go b/discovery/ec2/ec2.go index fb1c7ad342..c6fadd8212 100644 --- a/discovery/ec2/ec2.go +++ b/discovery/ec2/ec2.go @@ -77,6 +77,7 @@ type Filter struct { // SDConfig is the configuration for EC2 based service discovery. type SDConfig struct { + Endpoint string `yaml:"endpoint"` Region string `yaml:"region"` AccessKey string `yaml:"access_key,omitempty"` SecretKey config_util.Secret `yaml:"secret_key,omitempty"` @@ -143,6 +144,7 @@ func NewDiscovery(conf *SDConfig, logger log.Logger) *Discovery { } return &Discovery{ aws: &aws.Config{ + Endpoint: &conf.Endpoint, Region: &conf.Region, Credentials: creds, }, diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md index fe0a8dcda2..6a164200b5 100644 --- a/docs/configuration/configuration.md +++ b/docs/configuration/configuration.md @@ -416,6 +416,9 @@ See below for the configuration options for EC2 discovery: # The AWS Region. region: +# Custom endpoint to be used. +[ endpoint: ] + # The AWS API keys. If blank, the environment variables `AWS_ACCESS_KEY_ID` # and `AWS_SECRET_ACCESS_KEY` are used. [ access_key: ]