Skip to content

Commit

Permalink
Merge pull request #1553 from Azanul/develop
Browse files Browse the repository at this point in the history
fix: aws client 400 error, throtelling
  • Loading branch information
Azanul authored Dec 2, 2024
2 parents 4622c9e + 20bb06e commit c1d5ba9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
}
Expand All @@ -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{}{
Expand Down

0 comments on commit c1d5ba9

Please sign in to comment.