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 <git@jf-projects.de>
This commit is contained in:
Jannick Fahlbusch ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ 2018-07-18 11:48:14 +02:00 committed by Brian Brazil
parent 95dfb1b1dd
commit 0be25f92e2
2 changed files with 5 additions and 0 deletions

View File

@ -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,
},

View File

@ -416,6 +416,9 @@ See below for the configuration options for EC2 discovery:
# The AWS Region.
region: <string>
# Custom endpoint to be used.
[ endpoint: <string> ]
# The AWS API keys. If blank, the environment variables `AWS_ACCESS_KEY_ID`
# and `AWS_SECRET_ACCESS_KEY` are used.
[ access_key: <string> ]