RoleGrants

class aws_cdk.aws_iam.RoleGrants(*args: Any, **kwargs)

Bases: object

Collection of grant methods for a IRoleRef.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iam as iam
from aws_cdk.interfaces import aws_iam as interfaces_aws_iam

# role_ref: interfaces_aws_iam.IRoleRef

role_grants = iam.RoleGrants.from_role(role_ref)

Methods

assume_role(identity)

Grant permissions to the given principal to assume this role.

Parameters:

identity (IPrincipal)

Return type:

Grant

pass_role(identity)

Grant permissions to the given principal to pass this role.

Parameters:

identity (IPrincipal)

Return type:

Grant

Static Methods

classmethod from_role(role)

Creates grants for IRoleRef.

Parameters:

role (IRoleRef)

Return type:

RoleGrants