Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-0.50] fix(sdk-config): drop web identity usage from v1 default config #2131

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions pkg/utils/connect/aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
stscredstypesv2 "github.com/aws/aws-sdk-go-v2/service/sts/types"
awsv1 "github.com/aws/aws-sdk-go/aws"
credentialsv1 "github.com/aws/aws-sdk-go/aws/credentials"
stscredsv1 "github.com/aws/aws-sdk-go/aws/credentials/stscreds"
defaultsv1 "github.com/aws/aws-sdk-go/aws/defaults"
endpointsv1 "github.com/aws/aws-sdk-go/aws/endpoints"
requestv1 "github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
Expand Down Expand Up @@ -672,17 +672,8 @@ func GetDefaultConfigV1() (*awsv1.Config, error) {
muV1.Lock()
defer muV1.Unlock()
if defaultConfigV1 == nil {
cfg := awsv1.NewConfig()
sess, err := GetSessionV1(cfg)
if err != nil {
return nil, errors.Wrap(err, "failed to load default AWS config")
}
envCfg, err := config.NewEnvConfig()
if err != nil {
return nil, errors.Wrap(err, "failed to load default AWS env config")
}
creds := stscredsv1.NewWebIdentityCredentials(sess, envCfg.RoleARN, envCfg.RoleSessionName, envCfg.WebIdentityTokenFilePath) //nolint:staticcheck
defaultConfigV1 = cfg.WithCredentials(creds)
// use the sdk's default config
defaultConfigV1 = defaultsv1.Get().Config
}
return defaultConfigV1.Copy(), nil
}
Expand Down