From 9077fdd791da95327f69a5c2a4b17a034ef57ebc Mon Sep 17 00:00:00 2001 From: Richard Tweed Date: Fri, 16 Aug 2024 11:06:20 +0100 Subject: [PATCH] Update role.test.ts with test for custom assumeRoleAction --- packages/aws-cdk-lib/aws-iam/test/role.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 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..03f03a66a5351 100644 --- a/packages/aws-cdk-lib/aws-iam/test/role.test.ts +++ b/packages/aws-cdk-lib/aws-iam/test/role.test.ts @@ -219,6 +219,7 @@ describe('customizeRoles', () => { // WHEN const role = new Role(stack, 'Role', { assumedBy: new ServicePrincipal('sns.amazonaws.com'), + assumeRoleAction: "sts:AssumeRoleWithWebIdentity"; }); const principal = Role.fromRoleName(stack, 'OtherRole', 'OtherRole'); role.grant(principal, 'sts:AssumeRole'); @@ -288,7 +289,7 @@ describe('customizeRoles', () => { }, conditions: {}, }, - AssumeRoleAction: 'sts:AssumeRole', + AssumeRoleAction: 'sts:AssumeRoleWithWebIdentity', PrincipalAccount: { Ref: 'AWS::AccountId', }, @@ -1435,4 +1436,4 @@ test('roleName validation with Tokens', () =>{ }).not.toThrow('Invalid roleName'); jest.clearAllMocks(); -}); \ No newline at end of file +});