CustomAttributeConfig

class aws_cdk.aws_cognito.CustomAttributeConfig(*, data_type, mutable=None, number_constraints=None, string_constraints=None)

Bases: object

Configuration that will be fed into CloudFormation for any custom attribute type.

Parameters:
  • data_type (str) – The data type of the custom attribute.

  • mutable (Optional[bool]) – Specifies whether the value of the attribute can be changed. For any user pool attribute that’s mapped to an identity provider attribute, you must set this parameter to true. Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute. Default: false

  • number_constraints (Union[NumberAttributeConstraints, Dict[str, Any], None]) – The constraints for a custom attribute of the ‘Number’ data type. Default: - None.

  • string_constraints (Union[StringAttributeConstraints, Dict[str, Any], None]) – The constraints for a custom attribute of ‘String’ data type. Default: - None.

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 as cognito

custom_attribute_config = cognito.CustomAttributeConfig(
    data_type="dataType",

    # the properties below are optional
    mutable=False,
    number_constraints=cognito.NumberAttributeConstraints(
        max=123,
        min=123
    ),
    string_constraints=cognito.StringAttributeConstraints(
        max_len=123,
        min_len=123
    )
)

Attributes

data_type

The data type of the custom attribute.

See:

https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SchemaAttributeType.html#CognitoUserPools-Type-SchemaAttributeType-AttributeDataType

mutable

Specifies whether the value of the attribute can be changed.

For any user pool attribute that’s mapped to an identity provider attribute, you must set this parameter to true. Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute.

Default:

false

number_constraints

The constraints for a custom attribute of the ‘Number’ data type.

Default:
  • None.

string_constraints

The constraints for a custom attribute of ‘String’ data type.

Default:
  • None.