Skip to content
v2.273.0

NumberAttributeProps Struct ​

Props for NumberAttr.

Example ​

ts
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 ​

maxnumbermaxint | floatmaxNumberMaxdoubleMax*float64= no maximum value#
Maximum value of this attribute.
minnumberminint | floatminNumberMindoubleMin*float64= no minimum value#
Minimum value of this attribute.
mutablebooleanmutableboolmutableBooleanMutableboolMutable*bool= false#
Specifies whether the value of the attribute can be changed.
notes

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.

Used as props by ​