Skip to content

Commit

Permalink
Merge branch 'dippynark-add-irsa-support'
Browse files Browse the repository at this point in the history
  • Loading branch information
abutaha committed Jun 5, 2020
2 parents 68ec4a7 + ce72175 commit 9ce50f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aws-es-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
v4 "github.com/aws/aws-sdk-go/aws/signer/v4"
Expand Down Expand Up @@ -196,6 +197,11 @@ func (p *proxy) getSigner() *v4.Signer {
}

credentials := sess.Config.Credentials
awsRoleARN := os.Getenv("AWS_ROLE_ARN")
awsWebIdentityTokenFile := os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE")
if awsRoleARN != "" && awsWebIdentityTokenFile != "" {
credentials = stscreds.NewWebIdentityCredentials(sess, awsRoleARN, "", awsWebIdentityTokenFile)
}
p.credentials = credentials
logrus.Infoln("Generated fresh AWS Credentials object")
}
Expand Down

0 comments on commit 9ce50f8

Please sign in to comment.