Skip to content

Commit

Permalink
fix(cli): sts retry options are ignored (#32227)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
iliapolo authored Nov 21, 2024
1 parent 5178050 commit 193ab8c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 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 * (2 ** attempt));

/**
* Whether we have proof that the credentials have not expired
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 193ab8c

Please sign in to comment.