IIdentity

class aws_cdk.aws_iam.IIdentity(*args, **kwargs)

Bases: aws_cdk.aws_iam.IPrincipal, aws_cdk.core.IResource, typing_extensions.Protocol

A construct that represents an IAM principal, such as a user, group or role.

__init__(*args, **kwargs)

Methods

add_managed_policy(policy)

Attaches a managed policy to this principal.

Parameters

policy (IManagedPolicy) – The managed policy.

Return type

None

add_to_policy(statement)

Add to the policy of this principal.

Parameters

statement (PolicyStatement) –

return :rtype: bool :return:

true if the statement was added, false if the principal in question does not have a policy document to add the statement to.

deprecated :deprecated: Use addToPrincipalPolicy instead.

stability :stability: deprecated

add_to_principal_policy(statement)

Add to the policy of this principal.

Parameters

statement (PolicyStatement) –

Return type

AddToPrincipalPolicyResult

attach_inline_policy(policy)

Attaches an inline policy to this principal.

This is the same as calling policy.addToXxx(principal).

Parameters

policy (Policy) – The policy resource to attach to this principal [disable-awslint:ref-via-interface].

Return type

None

Attributes

assume_role_action

When this Principal is used in an AssumeRole policy, the action to use.

Return type

str

grant_principal

The principal to grant permissions to.

Return type

IPrincipal

node

The construct tree node for this construct.

Return type

ConstructNode

policy_fragment

Return the policy fragment that identifies this principal in a Policy.

Return type

PrincipalPolicyFragment

stack

The stack in which this resource is defined.

Return type

Stack