From 32560baaabbb01f4740e20c1b0a5696f097ad3eb Mon Sep 17 00:00:00 2001 From: epolon Date: Thu, 21 Nov 2024 08:31:18 +0200 Subject: [PATCH] mid work --- packages/aws-cdk/lib/api/aws-auth/sdk.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/aws-cdk/lib/api/aws-auth/sdk.ts b/packages/aws-cdk/lib/api/aws-auth/sdk.ts index e8489776ceebc..f03cb13e11a32 100644 --- a/packages/aws-cdk/lib/api/aws-auth/sdk.ts +++ b/packages/aws-cdk/lib/api/aws-auth/sdk.ts @@ -530,10 +530,7 @@ export class SDK { /** * STS is used to check credential validity, don't do too many retries. */ - private readonly stsRetryOptions = { - maxRetries: 3, - retryDelayOptions: { base: 100 }, - }; + private readonly stsRetryStrategy = new ConfiguredRetryStrategy(3, (attempt) => 100 * 1000 * (2 ** attempt)); /** * Whether we have proof that the credentials have not expired @@ -553,7 +550,7 @@ export class SDK { region, credentials: _credentials, requestHandler, - retryStrategy: new ConfiguredRetryStrategy(7, (attempt) => 300 * (2 ** attempt)), + retryStrategy: new ConfiguredRetryStrategy(7, (attempt) => 300 * 1000 * (2 ** attempt)), customUserAgent: defaultCliUserAgent(), }; this.currentRegion = region; @@ -950,7 +947,7 @@ export class SDK { debug('Looking up default account ID from STS'); const client = new STSClient({ ...this.config, - ...this.stsRetryOptions, + retryStrategy: this.stsRetryStrategy, }); const command = new GetCallerIdentityCommand({}); const result = await client.send(command); @@ -977,7 +974,7 @@ export class SDK { return; } - const client = new STSClient({ ...this.config, ...this.stsRetryOptions }); + const client = new STSClient({ ...this.config, retryStrategy: this.stsRetryStrategy }); await client.send(new GetCallerIdentityCommand({})); this._credentialsValidated = true; }