aws-cdk-lib.aws_cognito.NumberAttributeProps

interface NumberAttributeProps

LanguageType name
.NETAmazon.CDK.AWS.Cognito.NumberAttributeProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscognito#NumberAttributeProps
Javasoftware.amazon.awscdk.services.cognito.NumberAttributeProps
Pythonaws_cdk.aws_cognito.NumberAttributeProps
TypeScript (source)aws-cdk-lib » aws_cognito » NumberAttributeProps

Props for NumberAttr.

Example

new cognito.UserPool(this, 'myuserpool', {
  // ...
  standardAttributes: {
    fullname: {
      required: true,
      mutable: false,
    },
    address: {
      required: false,
      mutable: true,
    },
  },
  customAttributes: {
    'myappid': new cognito.StringAttribute({ minLen: 5, maxLen: 15, mutable: false }),
    'callingcode': new cognito.NumberAttribute({ min: 1, max: 3, mutable: true }),
    'isEmployee': new cognito.BooleanAttribute({ mutable: true }),
    'joinedOn': new cognito.DateTimeAttribute(),
  },
});

Properties

NameTypeDescription
max?numberMaximum value of this attribute.
min?numberMinimum value of this attribute.
mutable?booleanSpecifies whether the value of the attribute can be changed.

max?

Type: number (optional, default: no maximum value)

Maximum value of this attribute.


min?

Type: number (optional, default: no minimum value)

Minimum value of this attribute.


mutable?

Type: boolean (optional, default: false)

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.