ServicePrincipal

class aws_cdk.aws_iam.ServicePrincipal(service, *, conditions=None, region=None)

Bases: aws_cdk.aws_iam.PrincipalBase

An IAM principal that represents an AWS service (i.e. sqs.amazonaws.com).

__init__(service, *, conditions=None, region=None)
Parameters
  • service (str) –

  • conditions (Optional[Mapping[str, Any]]) – Additional conditions to add to the Service Principal. Default: - No conditions

  • region (Optional[str]) – The region in which the service is operating. Default: the current Stack’s region.

Return type

None

Methods

add_to_policy(_statement)

Add to the policy of this principal.

Parameters

_statement (PolicyStatement) –

Return type

bool

to_json()
Return type

Mapping[str, List[str]]

to_string()

Returns a string representation of an object.

Return type

str

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

policy_fragment

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

Return type

PrincipalPolicyFragment

service
Return type

str