-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access ManagementbugThis issue is a bug.This issue is a bug.
Description
Describe the bug
Role.grantAssumeRole()
does not make any difference in the generated policy.
Expected Behavior
grantAssumeRole
should grant the given princial permission to assume the role.
Current Behavior
No-op.
Reproduction Steps
const role = new Role(this, 'role', {
assumedBy: new AccountPrincipal(this.account)
})
role.grantAssumeRole(new AccountPrincipal('123456789')) // no-op
Possible Solution
No response
Additional Information/Context
Workaround:
const role = new Role(this, 'role', {
assumedBy: new AccountPrincipal(this.account)
})
//role.grantAssumeRole(new AccountPrincipal('123456789'))
role.assumeRolePolicy?.addStatements(
new PolicyStatement({
effect: Effect.ALLOW,
actions: ['sts:AssumeRole'],
principals: [new AccountPrincipal('123456789')]
})
)
CDK CLI Version
2.67.0
Framework Version
No response
Node.js Version
v18.14.2
OS
Ubuntu
Language
Typescript
Language Version
No response
Other information
No response
IllarionovDimitri, graydenshand and CloutKhan
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access ManagementbugThis issue is a bug.This issue is a bug.