From c5d19ed105497536594486900828f0f28a951df2 Mon Sep 17 00:00:00 2001 From: David Choy Date: Tue, 4 May 2021 08:41:59 -0700 Subject: [PATCH] Use previously created AWS session Use previously created session to avoid using deprecated session.New() Use session.NewSession() to allow AWS IRSA --- outputs/aws.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs/aws.go b/outputs/aws.go index 5089082942..0308663fa0 100644 --- a/outputs/aws.go +++ b/outputs/aws.go @@ -46,7 +46,7 @@ func NewAWSClient(config *types.Configuration, stats *types.Statistics, promStat return nil, errors.New("Error while creating AWS Session") } - _, err = sts.New(session.New()).GetCallerIdentity(&sts.GetCallerIdentityInput{}) + _, err = sts.New(sess).GetCallerIdentity(&sts.GetCallerIdentityInput{}) if err != nil { log.Printf("[ERROR] : AWS - %v\n", "Error while getting AWS Token") return nil, errors.New("Error while getting AWS Token")