Remove AWS credential check from cloudwatch output (#3583)
This method is reported to not work with IAM Instance Profiles, and we
do not want to make any calls that would require additional permissions.
(cherry picked from commit 5b40173bcb
)
This commit is contained in:
parent
425b6f7d63
commit
fe91c779e9
|
@ -9,7 +9,6 @@ import (
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/cloudwatch"
|
"github.com/aws/aws-sdk-go/service/cloudwatch"
|
||||||
"github.com/aws/aws-sdk-go/service/sts"
|
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
internalaws "github.com/influxdata/telegraf/internal/config/aws"
|
internalaws "github.com/influxdata/telegraf/internal/config/aws"
|
||||||
|
@ -71,20 +70,7 @@ func (c *CloudWatch) Connect() error {
|
||||||
Token: c.Token,
|
Token: c.Token,
|
||||||
}
|
}
|
||||||
configProvider := credentialConfig.Credentials()
|
configProvider := credentialConfig.Credentials()
|
||||||
|
|
||||||
stsService := sts.New(configProvider)
|
|
||||||
|
|
||||||
params := &sts.GetSessionTokenInput{}
|
|
||||||
|
|
||||||
_, err := stsService.GetSessionToken(params)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("E! cloudwatch: Cannot use credentials to connect to AWS : %+v \n", err.Error())
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
c.svc = cloudwatch.New(configProvider)
|
c.svc = cloudwatch.New(configProvider)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue