RoleMappingRule

class aws_cdk.aws_cognito_identitypool.RoleMappingRule(*, claim, claim_value, mapped_role, match_type=None)

Bases: object

(experimental) Represents an Identity Pool Role Attachment Role Mapping Rule.

Parameters:
  • claim (str) – (experimental) The key sent in the token by the federated identity provider.

  • claim_value (str) – (experimental) The value of the claim that must be matched.

  • mapped_role (IRole) – (experimental) The Role to be assumed when Claim Value is matched.

  • match_type (Optional[RoleMappingMatchType]) – (experimental) How to match with the Claim value. Default: RoleMappingMatchType.EQUALS

Stability:

experimental

ExampleMetadata:

fixture=_generated

Example:

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

# role: iam.Role

role_mapping_rule = cognito_identitypool.RoleMappingRule(
    claim="claim",
    claim_value="claimValue",
    mapped_role=role,

    # the properties below are optional
    match_type=cognito_identitypool.RoleMappingMatchType.EQUALS
)

Attributes

claim

(experimental) The key sent in the token by the federated identity provider.

Stability:

experimental

claim_value

(experimental) The value of the claim that must be matched.

Stability:

experimental

mapped_role

(experimental) The Role to be assumed when Claim Value is matched.

Stability:

experimental

match_type

(experimental) How to match with the Claim value.

Default:

RoleMappingMatchType.EQUALS

Stability:

experimental