CustomDomainOptions

class aws_cdk.aws_cognito.CustomDomainOptions(*, certificate, domain_name)

Bases: object

Options while specifying custom domain.

Parameters:
  • certificate (ICertificate) – The certificate to associate with this domain.

  • domain_name (str) – The custom domain name that you would like to associate with this User Pool.

See:

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

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

certificate

The certificate to associate with this domain.

domain_name

The custom domain name that you would like to associate with this User Pool.