Skip to content

Commit

Permalink
mid work
Browse files Browse the repository at this point in the history
  • Loading branch information
iliapolo committed Nov 21, 2024
1 parent 5d61a1b commit 32560ba
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/aws-cdk/lib/api/aws-auth/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit 32560ba

Please sign in to comment.