aws-cdk-lib.aws_cognito.UserPoolDomainOptions

interface UserPoolDomainOptions

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

Options to create a UserPoolDomain.

Example

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

NameTypeDescription
cognitoDomain?CognitoDomainOptionsAssociate a cognito prefix domain with your user pool Either customDomain or cognitoDomain must be specified.
customDomain?CustomDomainOptionsAssociate a custom domain with your user pool Either customDomain or cognitoDomain must be specified.

cognitoDomain?

Type: CognitoDomainOptions (optional, default: not set if customDomain is specified, otherwise, throws an error.)

Associate a cognito prefix domain with your user pool Either customDomain or cognitoDomain must be specified.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-assign-domain-prefix.html


customDomain?

Type: CustomDomainOptions (optional, default: not set if cognitoDomain is specified, otherwise, throws an error.)

Associate a custom domain with your user pool Either customDomain or cognitoDomain must be specified.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html