Skip to content

RoleMapping

Source code in docs_src/capo_cognito_identity/types/role_mapping.py
class RoleMapping(TypedDict, closed=True):
    type: "capo_cognito_identity.types.role_mapping_type.RoleMappingType"
    """<p>The role mapping type. Token will use <code>cognito:roles</code> and <code>cognito:preferred_role</code> claims from the Cognito identity provider token to map groups to roles. Rules will attempt to match claims from the token to map to a role.</p>"""
    ambiguous_role_resolution: NotRequired[
        "capo_cognito_identity.types.ambiguous_role_resolution_type.AmbiguousRoleResolutionType"
    ]
    """<p>If you specify Token or Rules as the <code>Type</code>, <code>AmbiguousRoleResolution</code> is required.</p> <p>Specifies the action to be taken if either no rules match the claim value for the <code>Rules</code> type, or there is no <code>cognito:preferred_role</code> claim and there are multiple <code>cognito:roles</code> matches for the <code>Token</code> type.</p>"""
    rules_configuration: NotRequired[
        "capo_cognito_identity.types.rules_configuration_type.RulesConfigurationType"
    ]
    """<p>The rules to be used for mapping users to roles.</p> <p>If you specify Rules as the role mapping type, <code>RulesConfiguration</code> is required.</p>"""

ambiguous_role_resolution instance-attribute

ambiguous_role_resolution: NotRequired[AmbiguousRoleResolutionType]

If you specify Token or Rules as the Type, AmbiguousRoleResolution is required.

Specifies the action to be taken if either no rules match the claim value for the Rules type, or there is no cognito:preferred_role claim and there are multiple cognito:roles matches for the Token type.

rules_configuration instance-attribute

rules_configuration: NotRequired[RulesConfigurationType]

The rules to be used for mapping users to roles.

If you specify Rules as the role mapping type, RulesConfiguration is required.

type instance-attribute

The role mapping type. Token will use cognito:roles and cognito:preferred_role claims from the Cognito identity provider token to map groups to roles. Rules will attempt to match claims from the token to map to a role.