CfnIdentityPoolRoleAttachmentPropsMixin
- class aws_cdk.mixins_preview.aws_cognito.mixins.CfnIdentityPoolRoleAttachmentPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::Cognito::IdentityPoolRoleAttachmentresource manages the role configuration for an Amazon Cognito identity pool.- See:
- CloudformationResource:
AWS::Cognito::IdentityPoolRoleAttachment
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_cognito import mixins as cognito_mixins # roles: Any cfn_identity_pool_role_attachment_props_mixin = cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin(cognito_mixins.CfnIdentityPoolRoleAttachmentMixinProps( identity_pool_id="identityPoolId", role_mappings={ "role_mappings_key": cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin.RoleMappingProperty( ambiguous_role_resolution="ambiguousRoleResolution", identity_provider="identityProvider", rules_configuration=cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin.RulesConfigurationTypeProperty( rules=[cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin.MappingRuleProperty( claim="claim", match_type="matchType", role_arn="roleArn", value="value" )] ), type="type" ) }, roles=roles ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::Cognito::IdentityPoolRoleAttachment.- Parameters:
props (
Union[CfnIdentityPoolRoleAttachmentMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['identityPoolId', 'roleMappings', 'roles']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
MappingRuleProperty
- class CfnIdentityPoolRoleAttachmentPropsMixin.MappingRuleProperty(*, claim=None, match_type=None, role_arn=None, value=None)
Bases:
objectDefines how to map a claim to a role ARN.
- Parameters:
claim (
Optional[str]) – The claim name that must be present in the token. For example: “isAdmin” or “paid”.match_type (
Optional[str]) – The match condition that specifies how closely the claim value in the IdP token must matchValue. Valid values are:Equals,Contains,StartsWith, andNotEqual.role_arn (
Optional[str]) – The Amazon Resource Name (ARN) of the role.value (
Optional[str]) – A brief string that the claim must match. For example, “paid” or “yes”.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_cognito import mixins as cognito_mixins mapping_rule_property = cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin.MappingRuleProperty( claim="claim", match_type="matchType", role_arn="roleArn", value="value" )
Attributes
- claim
The claim name that must be present in the token.
For example: “isAdmin” or “paid”.
- match_type
The match condition that specifies how closely the claim value in the IdP token must match
Value.Valid values are:
Equals,Contains,StartsWith, andNotEqual.
- role_arn
The Amazon Resource Name (ARN) of the role.
- value
A brief string that the claim must match.
For example, “paid” or “yes”.
RoleMappingProperty
- class CfnIdentityPoolRoleAttachmentPropsMixin.RoleMappingProperty(*, ambiguous_role_resolution=None, identity_provider=None, rules_configuration=None, type=None)
Bases:
objectOne of a set of
RoleMappings, a property of the AWS::Cognito::IdentityPoolRoleAttachment resource that defines the role-mapping attributes of an Amazon Cognito identity pool.- Parameters:
ambiguous_role_resolution (
Optional[str]) – If you specify Token or Rules as theType,AmbiguousRoleResolutionis required. Specifies the action to be taken if either no rules match the claim value for theRulestype, or there is nocognito:preferred_roleclaim and there are multiplecognito:rolesmatches for theTokentype.identity_provider (
Optional[str]) – Identifier for the identity provider for which the role is mapped. For example:graph.facebook.comorcognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id (http://cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id). This is the identity provider that is used by the user for authentication. If the identity provider property isn’t provided, the key of the entry in theRoleMappingsmap is used as the identity provider.rules_configuration (
Union[IResolvable,RulesConfigurationTypeProperty,Dict[str,Any],None]) – The rules to be used for mapping users to roles. If you specify “Rules” as the role-mapping type, RulesConfiguration is required.type (
Optional[str]) – The role mapping type. Token will usecognito:rolesandcognito:preferred_roleclaims 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.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_cognito import mixins as cognito_mixins role_mapping_property = cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin.RoleMappingProperty( ambiguous_role_resolution="ambiguousRoleResolution", identity_provider="identityProvider", rules_configuration=cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin.RulesConfigurationTypeProperty( rules=[cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin.MappingRuleProperty( claim="claim", match_type="matchType", role_arn="roleArn", value="value" )] ), type="type" )
Attributes
- ambiguous_role_resolution
If you specify Token or Rules as the
Type,AmbiguousRoleResolutionis required.Specifies the action to be taken if either no rules match the claim value for the
Rulestype, or there is nocognito:preferred_roleclaim and there are multiplecognito:rolesmatches for theTokentype.
- identity_provider
Identifier for the identity provider for which the role is mapped.
For example:
graph.facebook.comorcognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id (http://cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id). This is the identity provider that is used by the user for authentication.If the identity provider property isn’t provided, the key of the entry in the
RoleMappingsmap is used as the identity provider.
- rules_configuration
The rules to be used for mapping users to roles.
If you specify “Rules” as the role-mapping type, RulesConfiguration is required.
- type
The role mapping type.
Token will use
cognito:rolesandcognito:preferred_roleclaims 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.
RulesConfigurationTypeProperty
- class CfnIdentityPoolRoleAttachmentPropsMixin.RulesConfigurationTypeProperty(*, rules=None)
Bases:
objectRulesConfigurationTypeis a subproperty of the RoleMapping property that defines the rules to be used for mapping users to roles.- Parameters:
rules (
Union[IResolvable,Sequence[Union[IResolvable,MappingRuleProperty,Dict[str,Any]]],None]) – The rules. You can specify up to 25 rules per identity provider.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_cognito import mixins as cognito_mixins rules_configuration_type_property = cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin.RulesConfigurationTypeProperty( rules=[cognito_mixins.CfnIdentityPoolRoleAttachmentPropsMixin.MappingRuleProperty( claim="claim", match_type="matchType", role_arn="roleArn", value="value" )] )
Attributes
- rules
The rules.
You can specify up to 25 rules per identity provider.