From 90bdc2098f289a9b6d39a6535ea25da257d9dac4 Mon Sep 17 00:00:00 2001 From: Benoit Durand Date: Sat, 29 Jun 2024 15:08:21 +0200 Subject: [PATCH] Fix few test with incorrect mock AWS account id --- packages/aws-cdk-lib/aws-iam/test/role.test.ts | 2 +- packages/aws-cdk-lib/aws-lambda/test/function-url.test.ts | 2 +- packages/aws-cdk-lib/aws-secretsmanager/test/secret.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/aws-iam/test/role.test.ts b/packages/aws-cdk-lib/aws-iam/test/role.test.ts index 1733b256400c1..2f0da60411517 100644 --- a/packages/aws-cdk-lib/aws-iam/test/role.test.ts +++ b/packages/aws-cdk-lib/aws-iam/test/role.test.ts @@ -414,7 +414,7 @@ describe('IAM role', () => { }); // THEN - expect(() => role.grantAssumeRole(new AccountPrincipal('123456789'))) + expect(() => role.grantAssumeRole(new AccountPrincipal('123456789012'))) .toThrow('Cannot use a service or account principal with grantAssumeRole, use assumeRolePolicy instead.'); }); diff --git a/packages/aws-cdk-lib/aws-lambda/test/function-url.test.ts b/packages/aws-cdk-lib/aws-lambda/test/function-url.test.ts index 048fcea4fa1fa..61065556ebaa1 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/function-url.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/function-url.test.ts @@ -164,7 +164,7 @@ describe('FunctionUrl', () => { // GIVEN const stack = new cdk.Stack(); const role = new iam.Role(stack, 'Role', { - assumedBy: new iam.AccountPrincipal('1234'), + assumedBy: new iam.AccountPrincipal('123456789012'), }); const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), diff --git a/packages/aws-cdk-lib/aws-secretsmanager/test/secret.test.ts b/packages/aws-cdk-lib/aws-secretsmanager/test/secret.test.ts index 38ed48e3fbf55..b325641c43cad 100644 --- a/packages/aws-cdk-lib/aws-secretsmanager/test/secret.test.ts +++ b/packages/aws-cdk-lib/aws-secretsmanager/test/secret.test.ts @@ -382,7 +382,7 @@ test('grantRead cross account', () => { // GIVEN const key = new kms.Key(stack, 'KMS'); const secret = new secretsmanager.Secret(stack, 'Secret', { encryptionKey: key }); - const principal = new iam.AccountPrincipal('1234'); + const principal = new iam.AccountPrincipal('123456789012'); // WHEN secret.grantRead(principal, ['FOO', 'bar']).assertSuccess();