-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Switch from min throttle delay to retry mode (#488)
The v2 AWS SDK has no equivalent setting for a minimum delay for throttle errors. So, the delay has been replaced with the new retry mode configuration setting that is available. The "adaptive" mode accounts for throttle errors, although it is not configurable any further than that, and the mode itself is still experimental. The choice of retry mode still only applies to the SSM parameter store, but it could be extended to other implementations very easily. The `--min-throttle-delay` option remains in place so that existing scripted calls don't break, but the value no longer has any effect. The README is updated accordingly, mentioning the loss of min throttle delay as a breaking change. The removal of the `CHAMBER_NO_PATHS` avoiding of the path-based API for the SSM parameter store is also added as a breaking change, although that already happened when chamber moved to the v2 SDK.
- Loading branch information
Showing
10 changed files
with
108 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package store | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/aws/aws-sdk-go-v2/aws" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetConfig(t *testing.T) { | ||
originalEndpoint := os.Getenv(CustomSSMEndpointEnvVar) | ||
os.Setenv(CustomSSMEndpointEnvVar, "https://example.com/custom-endpoint") | ||
if originalEndpoint != "" { | ||
defer os.Setenv(CustomSSMEndpointEnvVar, originalEndpoint) | ||
} else { | ||
defer os.Unsetenv(CustomSSMEndpointEnvVar) | ||
} | ||
|
||
originalRegion := os.Getenv(RegionEnvVar) | ||
os.Setenv(RegionEnvVar, "us-west-2") | ||
if originalRegion != "" { | ||
defer os.Setenv(RegionEnvVar, originalRegion) | ||
} else { | ||
defer os.Unsetenv(RegionEnvVar) | ||
} | ||
|
||
config, region, err := getConfig(3, aws.RetryModeStandard) | ||
|
||
assert.NoError(t, err) | ||
assert.Equal(t, "us-west-2", region) | ||
|
||
endpoint, err := config.EndpointResolverWithOptions.ResolveEndpoint("ssm", "us-west-2") | ||
assert.Equal(t, "https://example.com/custom-endpoint", endpoint.URL) | ||
assert.Equal(t, aws.EndpointSourceCustom, endpoint.Source) | ||
|
||
assert.Equal(t, 3, config.RetryMaxAttempts) | ||
assert.Equal(t, aws.RetryModeStandard, config.RetryMode) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters