Skip to content

Commit

Permalink
fix(aws): increased max attemps
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard committed Aug 25, 2022
1 parent e47ff58 commit d5fac52
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/aws/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/config"

"github.com/stangirard/yatas/internal/logger"
Expand All @@ -24,6 +25,9 @@ func createSessionWithCredentials(c yatas.AWS_Account) aws.Config {
if c.Profile == "" {
s, err := config.LoadDefaultConfig(context.TODO(),
config.WithRegion(c.Region),
config.WithRetryer(func() aws.Retryer {
return retry.AddWithMaxAttempts(retry.NewStandard(), 10)
}),
config.WithRetryMode(aws.RetryMode(aws.RetryModeAdaptive)),
)
if err != nil {
Expand All @@ -34,6 +38,9 @@ func createSessionWithCredentials(c yatas.AWS_Account) aws.Config {
s, err := config.LoadDefaultConfig(context.TODO(),
config.WithRegion(c.Region),
config.WithSharedConfigProfile(c.Profile),
config.WithRetryer(func() aws.Retryer {
return retry.AddWithMaxAttempts(retry.NewStandard(), 10)
}),
config.WithRetryMode(aws.RetryMode(aws.RetryModeAdaptive)),
)
if err != nil {
Expand All @@ -51,6 +58,9 @@ func createSessionWithSSO(c yatas.AWS_Account) aws.Config {
if c.Profile == "" {
s, err := config.LoadDefaultConfig(context.Background(),
config.WithRegion(c.Region),
config.WithRetryer(func() aws.Retryer {
return retry.AddWithMaxAttempts(retry.NewStandard(), 10)
}),
config.WithRetryMode(aws.RetryMode(aws.RetryModeAdaptive)),
)
if err != nil {
Expand All @@ -61,6 +71,9 @@ func createSessionWithSSO(c yatas.AWS_Account) aws.Config {
s, err := config.LoadDefaultConfig(context.Background(),
config.WithRegion(c.Region),
config.WithSharedConfigProfile(c.Profile),
config.WithRetryer(func() aws.Retryer {
return retry.AddWithMaxAttempts(retry.NewStandard(), 10)
}),
config.WithRetryMode(aws.RetryMode(aws.RetryModeAdaptive)),
)
if err != nil {
Expand Down

0 comments on commit d5fac52

Please sign in to comment.