Skip to content

Commit 193ab8c

Browse files
authored
fix(cli): sts retry options are ignored (#32227)
We were still using the SDK v2 properties, but SDK v3 uses different ones. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 5178050 commit 193ab8c

File tree

1 file changed

+3
-6
lines changed
  • packages/aws-cdk/lib/api/aws-auth

1 file changed

+3
-6
lines changed

Diff for: packages/aws-cdk/lib/api/aws-auth/sdk.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,7 @@ export class SDK {
530530
/**
531531
* STS is used to check credential validity, don't do too many retries.
532532
*/
533-
private readonly stsRetryOptions = {
534-
maxRetries: 3,
535-
retryDelayOptions: { base: 100 },
536-
};
533+
private readonly stsRetryStrategy = new ConfiguredRetryStrategy(3, (attempt) => 100 * (2 ** attempt));
537534

538535
/**
539536
* Whether we have proof that the credentials have not expired
@@ -950,7 +947,7 @@ export class SDK {
950947
debug('Looking up default account ID from STS');
951948
const client = new STSClient({
952949
...this.config,
953-
...this.stsRetryOptions,
950+
retryStrategy: this.stsRetryStrategy,
954951
});
955952
const command = new GetCallerIdentityCommand({});
956953
const result = await client.send(command);
@@ -977,7 +974,7 @@ export class SDK {
977974
return;
978975
}
979976

980-
const client = new STSClient({ ...this.config, ...this.stsRetryOptions });
977+
const client = new STSClient({ ...this.config, retryStrategy: this.stsRetryStrategy });
981978
await client.send(new GetCallerIdentityCommand({}));
982979
this._credentialsValidated = true;
983980
}

0 commit comments

Comments
 (0)