IComparablePrincipal

class aws_cdk.aws_iam.IComparablePrincipal(*args, **kwds)

Bases: IPrincipal, Protocol

Interface for principals that can be compared.

This only needs to be implemented for principals that could potentially be value-equal. Identity-equal principals will be handled correctly by default.

Methods

add_to_policy(statement)

(deprecated) Add to the policy of this principal.

Parameters:

statement (PolicyStatement) –

Return type:

bool

Returns:

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

Deprecated:

Use addToPrincipalPolicy instead.

Stability:

deprecated

add_to_principal_policy(statement)

Add to the policy of this principal.

Parameters:

statement (PolicyStatement) –

Return type:

AddToPrincipalPolicyResult

dedupe_string()

Return a string format of this principal which should be identical if the two principals are the same.

Return type:

Optional[str]

Attributes

assume_role_action

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

grant_principal

The principal to grant permissions to.

policy_fragment

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

principal_account

The AWS account ID of this principal.

Can be undefined when the account is not known (for example, for service principals). Can be a Token - in that case, it’s assumed to be AWS::AccountId.