Skip to content

Commit

Permalink
feat(aws): enable regional endpoint resolving for STS
Browse files Browse the repository at this point in the history
Signed-off-by: Casale, Robert <[email protected]>
  • Loading branch information
Gearheads committed Jul 27, 2023
1 parent a4c60c9 commit 7de05fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/plugins/identity/saml/sp/aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"go.uber.org/zap"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sts"

Expand Down Expand Up @@ -266,7 +267,8 @@ func (p *ServiceProvider) getRoleFromPrompt(accounts []*saml2aws.AWSAccount, rol

func (p *ServiceProvider) loginToStsUsingRole(account *cfg.IDPAccount, role *saml2aws.AWSRole, samlAssertion string) (*awsconfig.AWSCredentials, error) {
sess, err := session.NewSession(&aws.Config{
Region: &account.Region,
Region: &account.Region,
STSRegionalEndpoint: endpoints.RegionalSTSEndpoint,
})
if err != nil {
return nil, fmt.Errorf("creating aws session: %w", err)
Expand Down

0 comments on commit 7de05fe

Please sign in to comment.