# AttributeMapping

The mapping of user pool attributes to the attributes provided by the identity providers.

- Source: [`aws-cognito/lib/user-pool-idps/base.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-cognito/lib/user-pool-idps/base.ts#L86)
- Type last changed: v2.163.0 · 22 Oct 2024

## Example

```ts
const userpool = new cognito.UserPool(this, 'Pool');

new cognito.UserPoolIdentityProviderAmazon(this, 'Amazon', {
  clientId: 'amzn-client-id',
  clientSecret: 'amzn-client-secret',
  userPool: userpool,
  attributeMapping: {
    email: cognito.ProviderAttribute.AMAZON_EMAIL,
    website: cognito.ProviderAttribute.other('url'), // use other() when an attribute is not pre-defined in the CDK
    custom: {
      // custom user pool attributes go here
      uniqueId: cognito.ProviderAttribute.AMAZON_USER_ID,
    },
  },
});
```

## Properties

- `address`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's postal address is a required attribute.

  **Default:** not mapped

- `birthdate`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's birthday.

  **Default:** not mapped

- `custom`: { [key: string]: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) } — Specify custom attribute mapping here and mapping for any standard attributes not supported yet.

  **Default:** no custom attribute mapping

- `email`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's e-mail address.

  **Default:** not mapped

- `emailVerified`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's e-mail address is verification.

  **Default:** not mapped

- `familyName`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The surname or last name of user.

  **Default:** not mapped

- `fullname`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's full name in displayable form.

  **Default:** not mapped

- `gender`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's gender.

  **Default:** not mapped

- `givenName`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's first name or give name.

  **Default:** not mapped

- `lastUpdateTime`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — Time, the user's information was last updated.

  **Default:** not mapped

- `locale`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's locale.

  **Default:** not mapped

- `middleName`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's middle name.

  **Default:** not mapped

- `nickname`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's nickname or casual name.

  **Default:** not mapped

- `phoneNumber`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's telephone number.

  **Default:** not mapped

- `preferredUsername`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's preferred username.

  **Default:** not mapped

- `profilePage`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The URL to the user's profile page.

  **Default:** not mapped

- `profilePicture`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The URL to the user's profile picture.

  **Default:** not mapped

- `timezone`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The user's time zone.

  **Default:** not mapped

- `website`: [ProviderAttribute](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) — The URL to the user's web page or blog.

  **Default:** not mapped
