diff --git a/command/get.go b/command/get.go index 751118cb..21a8d458 100644 --- a/command/get.go +++ b/command/get.go @@ -8,7 +8,6 @@ import ( "time" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/sts" "github.com/riotgames/key-conjurer/oauth2" "github.com/spf13/cobra" @@ -182,12 +181,7 @@ func (g GetCommand) fetchNewCredentials(ctx context.Context, account Account, cf g.TimeToLive = cfg.TTL } - awsCfg, err := config.LoadDefaultConfig(ctx, config.WithRegion(g.Region)) - if err != nil { - return nil, err - } - - stsClient := sts.NewFromConfig(awsCfg) + stsClient := sts.New(sts.Options{Region: g.Region}) timeoutInSeconds := int32(3600 * g.TimeToLive) resp, err := stsClient.AssumeRoleWithSAML(ctx, &sts.AssumeRoleWithSAMLInput{ DurationSeconds: aws.Int32(timeoutInSeconds),