Skip to content

Commit 3a63e1c

Browse files
committed
Add 'Config.Backoff'.
1 parent fccf6cb commit 3a63e1c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

aws_config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ func resolveRetryer(ctx context.Context, c *Config, awsConfig *aws.Config) {
202202

203203
var standardOptions []func(*retry.StandardOptions)
204204

205+
if backoff := c.Backoff; backoff != nil {
206+
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
207+
so.Backoff = backoff
208+
})
209+
}
210+
205211
if v, found, _ := awsconfig.GetRetryMaxAttempts(ctx, awsConfig.ConfigSources); found && v != 0 {
206212
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
207213
so.MaxAttempts = v

internal/config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"time"
1414

1515
"github.com/aws/aws-sdk-go-v2/aws"
16+
"github.com/aws/aws-sdk-go-v2/aws/retry"
1617
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
1718
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
1819
"github.com/hashicorp/aws-sdk-go-base/v2/diag"
@@ -34,6 +35,7 @@ type Config struct {
3435
APNInfo *APNInfo
3536
AssumeRole *AssumeRole
3637
AssumeRoleWithWebIdentity *AssumeRoleWithWebIdentity
38+
Backoff retry.BackoffDelayer
3739
CallerDocumentationURL string
3840
CallerName string
3941
CustomCABundle string

0 commit comments

Comments
 (0)