Skip to content

Commit

Permalink
Use previously created AWS session
Browse files Browse the repository at this point in the history
Use previously created session to avoid using deprecated session.New()
Use session.NewSession() to allow AWS IRSA
  • Loading branch information
dchoy authored May 4, 2021
1 parent 4461d9b commit c5d19ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion outputs/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit c5d19ed

Please sign in to comment.