From 9ec65c14407af6347b5f3d485d43cca4747d731a Mon Sep 17 00:00:00 2001 From: Azanul Date: Mon, 2 Dec 2024 11:17:02 +0100 Subject: [PATCH] fix: aws client 400 error, throtelling Signed-off-by: Azanul --- internal/config/load.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/config/load.go b/internal/config/load.go index 2d3fda3f4..c529fb83b 100644 --- a/internal/config/load.go +++ b/internal/config/load.go @@ -92,6 +92,7 @@ func Load(configPath string, telemetry bool, analytics utils.Analytics) (*models } accounts = append(accounts, cloudAccount) + var cfg aws.Config if account.Source == "CREDENTIALS_FILE" { if len(account.Path) > 0 { cfg, err := awsConfig.LoadDefaultConfig(context.Background(), awsConfig.WithSharedConfigProfile(account.Profile), awsConfig.WithSharedCredentialsFiles( @@ -105,7 +106,7 @@ func Load(configPath string, telemetry bool, analytics utils.Analytics) (*models Name: account.Name, }) } else { - cfg, err := awsConfig.LoadDefaultConfig(context.Background(), awsConfig.WithSharedConfigProfile(account.Profile), awsConfig.WithRetryMode(aws.RetryModeAdaptive)) + cfg, err := awsConfig.LoadDefaultConfig(context.Background(), awsConfig.WithSharedConfigProfile(account.Profile)) if err != nil { return nil, nil, nil, err } @@ -125,6 +126,7 @@ func Load(configPath string, telemetry bool, analytics utils.Analytics) (*models Name: account.Name, }) } + cfg.RetryMode = aws.RetryModeAdaptive } if telemetry { analytics.TrackEvent("connected_account", map[string]interface{}{