class RoleGrants
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.IAM.RoleGrants |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsiam#RoleGrants |
Java | software.amazon.awscdk.services.iam.RoleGrants |
Python | aws_cdk.aws_iam.RoleGrants |
TypeScript (source) | aws-cdk-lib » aws_iam » RoleGrants |
Collection of grant methods for a IRoleRef.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_iam as interfaces_aws_iam } from 'aws-cdk-lib/interfaces';
declare const roleRef: interfaces_aws_iam.IRoleRef;
const roleGrants = iam.RoleGrants.fromRole(roleRef);
Methods
| Name | Description |
|---|---|
| assume | Grant permissions to the given principal to assume this role. |
| pass | Grant permissions to the given principal to pass this role. |
| static from | Creates grants for IRoleRef. |
assumeRole(identity)
public assumeRole(identity: IPrincipal): Grant
Parameters
- identity
IPrincipal
Returns
Grant permissions to the given principal to assume this role.
passRole(identity)
public passRole(identity: IPrincipal): Grant
Parameters
- identity
IPrincipal
Returns
Grant permissions to the given principal to pass this role.
static fromRole(role)
public static fromRole(role: IRoleRef): RoleGrants
Parameters
- role
IRoleRef
Returns
Creates grants for IRoleRef.

.NET
Go
Java
Python
TypeScript (