Skip to content

Commit

Permalink
Update role.test.ts with test for custom assumeRoleAction
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardoC authored Aug 16, 2024
1 parent 0e823a5 commit 9077fdd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/aws-cdk-lib/aws-iam/test/role.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -288,7 +289,7 @@ describe('customizeRoles', () => {
},
conditions: {},
},
AssumeRoleAction: 'sts:AssumeRole',
AssumeRoleAction: 'sts:AssumeRoleWithWebIdentity',
PrincipalAccount: {
Ref: 'AWS::AccountId',
},
Expand Down Expand Up @@ -1435,4 +1436,4 @@ test('roleName validation with Tokens', () =>{
}).not.toThrow('Invalid roleName');

jest.clearAllMocks();
});
});

0 comments on commit 9077fdd

Please sign in to comment.