mirror of
https://github.com/wahyd4/telegraf.git
synced 2026-08-20 18:16:38 +10:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user