# CustomAttributeProps

Constraints that can be applied to a custom attribute of any type.

Extends: CustomAttributeProps
Used as props by: BooleanAttribute, DateTimeAttribute

- Source: [`aws-cognito/lib/user-pool-attr.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-cognito/lib/user-pool-attr.ts#L202)

## 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

- `mutable`: boolean = 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.
