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q?=E0=B9=8E=E0=B9=8E=E0=B9=8E=E0=B9=8E=E0=B9=8E=E0=B9=8E=E0=B9=8E?= =?UTF-8?q?=E0=B9=8E=E0=B9=8E=E0=B9=8E=E0=B9=8E?= Date: Wed, 18 Jul 2018 11:48:14 +0200 Subject: [PATCH] EC2 Discovery: Allow to set a custom endpoint (#4333) Allowing to set a custom endpoint makes it easy to monitor targets on non AWS providers with EC2 compliant APIs. Signed-off-by: Jannick Fahlbusch --- discovery/ec2/ec2.go | 2 ++ docs/configuration/configuration.md | 3 +++ 2 files changed, 5 insertions(+) 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: ]