GrantOnPrincipalOptions

class aws_cdk.aws_iam.GrantOnPrincipalOptions(*, actions, grantee, resource_arns, conditions=None, scope=None)

Bases: CommonGrantOptions

Options for a grant operation that only applies to principals.

Parameters:
  • actions (Sequence[str]) – The actions to grant.

  • grantee (IGrantable) – The principal to grant to. Default: if principal is undefined, no work is done.

  • resource_arns (Sequence[str]) – The resource ARNs to grant to.

  • conditions (Optional[Mapping[str, Mapping[str, Any]]]) – Any conditions to attach to the grant. Default: - No conditions

  • scope (Optional[IConstruct]) – Construct to report warnings on in case grant could not be registered. Default: - the construct in which this construct is defined

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
import constructs as constructs

# conditions: Any
# construct: constructs.Construct
# grantable: iam.IGrantable

grant_on_principal_options = iam.GrantOnPrincipalOptions(
    actions=["actions"],
    grantee=grantable,
    resource_arns=["resourceArns"],

    # the properties below are optional
    conditions={
        "conditions_key": {
            "conditions_key": conditions
        }
    },
    scope=construct
)

Attributes

actions

The actions to grant.

conditions

Any conditions to attach to the grant.

Default:
  • No conditions

grantee

The principal to grant to.

Default:

if principal is undefined, no work is done.

resource_arns

The resource ARNs to grant to.

scope

Construct to report warnings on in case grant could not be registered.

Default:
  • the construct in which this construct is defined