diff --git a/packages/middleware-retry/package.json b/packages/middleware-retry/package.json index 62c78f846e595..f5d5b0e35bc74 100644 --- a/packages/middleware-retry/package.json +++ b/packages/middleware-retry/package.json @@ -18,7 +18,6 @@ "license": "Apache-2.0", "dependencies": { "@aws-sdk/protocol-http": "1.0.0-gamma.2", - "@aws-sdk/retry-config-provider": "1.0.0-gamma.1", "@aws-sdk/service-error-classification": "1.0.0-gamma.2", "@aws-sdk/types": "1.0.0-gamma.2", "react-native-get-random-values": "^1.4.0", diff --git a/packages/middleware-retry/src/defaultStrategy.spec.ts b/packages/middleware-retry/src/defaultStrategy.spec.ts index 3aa6481760128..86aed899be428 100644 --- a/packages/middleware-retry/src/defaultStrategy.spec.ts +++ b/packages/middleware-retry/src/defaultStrategy.spec.ts @@ -1,11 +1,10 @@ import { HttpRequest } from "@aws-sdk/protocol-http"; -import { DEFAULT_MAX_ATTEMPTS } from "@aws-sdk/retry-config-provider"; import { isThrottlingError } from "@aws-sdk/service-error-classification"; import { v4 } from "uuid"; import { DEFAULT_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, THROTTLING_RETRY_DELAY_BASE } from "./constants"; import { getDefaultRetryQuota } from "./defaultRetryQuota"; -import { RetryQuota, StandardRetryStrategy } from "./defaultStrategy"; +import { DEFAULT_MAX_ATTEMPTS, RetryQuota, StandardRetryStrategy } from "./defaultStrategy"; import { defaultDelayDecider } from "./delayDecider"; import { defaultRetryDecider } from "./retryDecider"; diff --git a/packages/middleware-retry/src/defaultStrategy.ts b/packages/middleware-retry/src/defaultStrategy.ts index 2c555c7ed63ad..1d89462a1bfa1 100644 --- a/packages/middleware-retry/src/defaultStrategy.ts +++ b/packages/middleware-retry/src/defaultStrategy.ts @@ -1,5 +1,4 @@ import { HttpRequest } from "@aws-sdk/protocol-http"; -import { DEFAULT_MAX_ATTEMPTS } from "@aws-sdk/retry-config-provider"; import { isThrottlingError } from "@aws-sdk/service-error-classification"; import { SdkError } from "@aws-sdk/smithy-client"; import { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider, RetryStrategy } from "@aws-sdk/types"; @@ -10,6 +9,17 @@ import { getDefaultRetryQuota } from "./defaultRetryQuota"; import { defaultDelayDecider } from "./delayDecider"; import { defaultRetryDecider } from "./retryDecider"; +/** + * The default value for how many HTTP requests an SDK should make for a + * single SDK operation invocation before giving up + */ +export const DEFAULT_MAX_ATTEMPTS = "3"; + +/** + * The default retry algorithm to use. + */ +export const DEFAULT_RETRY_MODE = "standard"; + /** * Determines whether an error is retryable based on the number of retries * already attempted, the HTTP status code, and the error received (if any). diff --git a/packages/retry-config-provider/package.json b/packages/retry-config-provider/package.json index b12161ea87708..a45a6c5145e73 100644 --- a/packages/retry-config-provider/package.json +++ b/packages/retry-config-provider/package.json @@ -22,6 +22,7 @@ }, "license": "Apache-2.0", "dependencies": { + "@aws-sdk/middleware-retry": "1.0.0-gamma.2", "@aws-sdk/property-provider": "1.0.0-gamma.2", "@aws-sdk/shared-ini-file-loader": "1.0.0-gamma.2", "@aws-sdk/types": "1.0.0-gamma.2", diff --git a/packages/retry-config-provider/src/defaultProvider.spec.ts b/packages/retry-config-provider/src/defaultProvider.spec.ts index 008d31203932c..52a33bc46ecd4 100644 --- a/packages/retry-config-provider/src/defaultProvider.spec.ts +++ b/packages/retry-config-provider/src/defaultProvider.spec.ts @@ -1,10 +1,9 @@ +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; import { chain, fromStatic, memoize } from "@aws-sdk/property-provider"; import { CONFIG_MAX_ATTEMPTS, CONFIG_RETRY_MODE, - DEFAULT_MAX_ATTEMPTS, - DEFAULT_RETRY_MODE, ENV_MAX_ATTEMPTS, ENV_RETRY_MODE, maxAttemptsProvider, diff --git a/packages/retry-config-provider/src/defaultProvider.ts b/packages/retry-config-provider/src/defaultProvider.ts index c0edc4aba66ec..560e059150a3e 100644 --- a/packages/retry-config-provider/src/defaultProvider.ts +++ b/packages/retry-config-provider/src/defaultProvider.ts @@ -1,3 +1,4 @@ +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; import { chain, fromStatic, memoize } from "@aws-sdk/property-provider"; import { Provider } from "@aws-sdk/types"; @@ -6,11 +7,9 @@ import { fromSharedConfigFiles, SharedConfigInit } from "./fromSharedConfigFiles export const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; export const CONFIG_MAX_ATTEMPTS = "max_attempts"; -export const DEFAULT_MAX_ATTEMPTS = "3"; export const ENV_RETRY_MODE = "AWS_RETRY_MODE"; export const CONFIG_RETRY_MODE = "retry_mode"; -export const DEFAULT_RETRY_MODE = "standard"; const defaultProvider = ( configuration: SharedConfigInit = {},