# UserPoolDomainOptions

Options to create a UserPoolDomain.

- Source: [`aws-cognito/lib/user-pool-domain.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-cognito/lib/user-pool-domain.ts#L72)
- Type last changed: v2.177.0 · 25 Jan 2025

## Example

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

pool.addDomain('CognitoDomain', {
  cognitoDomain: {
    domainPrefix: 'my-awesome-app',
  },
});

const certificateArn = 'arn:aws:acm:us-east-1:123456789012:certificate/11-3336f1-44483d-adc7-9cd375c5169d';

const domainCert = certificatemanager.Certificate.fromCertificateArn(this, 'domainCert', certificateArn);
pool.addDomain('CustomDomain', {
  customDomain: {
    domainName: 'user.myapp.com',
    certificate: domainCert,
  },
});
```

## Properties

- `cognitoDomain`: [CognitoDomainOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.CognitoDomainOptions.html) — Associate a cognito prefix domain with your user pool Either `customDomain` or `cognitoDomain` must be specified.

  **Default:** not set if `customDomain` is specified, otherwise, throws an error.

- `customDomain`: [CustomDomainOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.CustomDomainOptions.html) — Associate a custom domain with your user pool Either `customDomain` or `cognitoDomain` must be specified.

  **Default:** not set if `cognitoDomain` is specified, otherwise, throws an error.

- `managedLoginVersion`: [ManagedLoginVersion](/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ManagedLoginVersion.html) — A version that indicates the state of managed login.

  **Default:** undefined - Cognito default setting is ManagedLoginVersion.CLASSIC_HOSTED_UI

  This choice applies to all app clients that host services at the domain.
