UserPoolDomainOptions

class aws_cdk.aws_cognito.UserPoolDomainOptions(*, cognito_domain=None, custom_domain=None)

Bases: object

Options to create a UserPoolDomain.

Parameters:
  • cognito_domain (Union[CognitoDomainOptions, Dict[str, Any], None]) – 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.

  • custom_domain (Union[CustomDomainOptions, Dict[str, Any], None]) – 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.

ExampleMetadata:

infused

Example:

pool = cognito.UserPool(self, "Pool")

pool.add_domain("CognitoDomain",
    cognito_domain=cognito.CognitoDomainOptions(
        domain_prefix="my-awesome-app"
    )
)

certificate_arn = "arn:aws:acm:us-east-1:123456789012:certificate/11-3336f1-44483d-adc7-9cd375c5169d"

domain_cert = certificatemanager.Certificate.from_certificate_arn(self, "domainCert", certificate_arn)
pool.add_domain("CustomDomain",
    custom_domain=cognito.CustomDomainOptions(
        domain_name="user.myapp.com",
        certificate=domain_cert
    )
)

Attributes

cognito_domain

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.

See:

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

custom_domain

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.

See:

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