Skip to content

Commit

Permalink
Fix with !cdk.Token.isUnresolved(accountId)
Browse files Browse the repository at this point in the history
  • Loading branch information
duranbe committed Jun 29, 2024
1 parent 0b225d2 commit aed7e0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-iam/lib/principals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ export class AccountPrincipal extends ArnPrincipal {
if (!cdk.Token.isUnresolved(accountId) && typeof accountId !== 'string') {
throw new Error('accountId should be of type string');
}
if (!this.accountIdRegExp.test(accountId)) {
if (!cdk.Token.isUnresolved(accountId) && !this.accountIdRegExp.test(accountId)) {
throw new Error('accountId should be composed of 12 digits');
}
this.principalAccount = accountId;
Expand Down

0 comments on commit aed7e0a

Please sign in to comment.