Skip to content

Commit f532d35

Browse files
authored
Merge pull request #1045 from hashicorp/f-configurable-retry.BackoffDelayer
Add configurable `retry.BackoffDelayer`
2 parents fccf6cb + d88efef commit f532d35

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
<!-- markdownlint-disable single-title -->
22
# v2.0.0 (Unreleased)
33

4+
# v2.0.0-beta.53 (2024-05-09)
5+
6+
BUG FIXES
7+
8+
* Updates dependencies.
9+
10+
ENHANCEMENTS
11+
12+
* Adds `Backoff` parameter to configure the backoff strategy the retryer will use to determine the delay between retry attempts ([#1045](https://github.com/hashicorp/aws-sdk-go-base/pull/1045))
13+
414
# v2.0.0-beta.52 (2024-04-11)
515

616
BUG FIXES

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

v2/awsv1shim/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1
1111
github.com/aws/aws-sdk-go-v2/service/sts v1.28.7
1212
github.com/google/go-cmp v0.6.0
13-
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.52
13+
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.53
1414
github.com/hashicorp/go-cleanhttp v0.5.2
1515
github.com/hashicorp/terraform-plugin-log v0.9.0
1616
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.51.0

0 commit comments

Comments
 (0)