From fe91c779e9aa0b4b3f1bc0901510dee8c87f7b48 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 13 Dec 2017 17:51:55 -0800 Subject: [PATCH] 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 5b40173bcb355a8186e543023517e45d2f35bccf) --- plugins/outputs/cloudwatch/cloudwatch.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/plugins/outputs/cloudwatch/cloudwatch.go b/plugins/outputs/cloudwatch/cloudwatch.go index b14953dbe..0c087ce57 100644 --- a/plugins/outputs/cloudwatch/cloudwatch.go +++ b/plugins/outputs/cloudwatch/cloudwatch.go @@ -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 }