Remove AWS credential check from cloudwatch output ()

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.
This commit is contained in:
Daniel Nelson 2017-12-13 17:51:55 -08:00 committed by GitHub
parent 6638fc68de
commit 5b40173bcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 14 deletions
plugins/outputs/cloudwatch

View File

@ -9,7 +9,6 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/influxdata/telegraf"
internalaws "github.com/influxdata/telegraf/internal/config/aws"
@ -71,20 +70,7 @@ func (c *CloudWatch) Connect() error {
Token: c.Token,
}
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)
return nil
}