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:
Daniel Nelson 2017-12-13 17:51:55 -08:00 committed by Daniel Nelson
parent 425b6f7d63
commit fe91c779e9
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 0 additions and 14 deletions

View File

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