DomainOptions

class aws_cdk.aws_amplify.DomainOptions(*, auto_subdomain_creation_patterns=None, domain_name=None, enable_auto_subdomain=None, sub_domains=None)

Bases: object

(experimental) Options to add a domain to an application.

Parameters:
  • auto_subdomain_creation_patterns (Optional[Sequence[str]]) – (experimental) Branches which should automatically create subdomains. Default: - all repository branches [‘*’, ‘pr*’]

  • domain_name (Optional[str]) – (experimental) The name of the domain. Default: - the construct’s id

  • enable_auto_subdomain (Optional[bool]) – (experimental) Automatically create subdomains for connected branches. Default: false

  • sub_domains (Optional[Sequence[Union[SubDomain, Dict[str, Any]]]]) – (experimental) Subdomains. Default: - use addSubDomain() to add subdomains

Stability:

experimental

ExampleMetadata:

infused

Example:

# amplify_app: amplify.App
# master: amplify.Branch
# dev: amplify.Branch


domain = amplify_app.add_domain("example.com",
    enable_auto_subdomain=True,  # in case subdomains should be auto registered for branches
    auto_subdomain_creation_patterns=["*", "pr*"]
)
domain.map_root(master) # map master branch to domain root
domain.map_sub_domain(master, "www")
domain.map_sub_domain(dev)

Attributes

auto_subdomain_creation_patterns

(experimental) Branches which should automatically create subdomains.

Default:
  • all repository branches [‘*’, ‘pr*’]

Stability:

experimental

domain_name

(experimental) The name of the domain.

Default:
  • the construct’s id

Stability:

experimental

enable_auto_subdomain

(experimental) Automatically create subdomains for connected branches.

Default:

false

Stability:

experimental

sub_domains

(experimental) Subdomains.

Default:
  • use addSubDomain() to add subdomains

Stability:

experimental