interface DomainOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Amplify.Alpha.DomainOptions |
Go | github.com/aws/aws-cdk-go/awscdkamplifyalpha/v2#DomainOptions |
Java | software.amazon.awscdk.services.amplify.alpha.DomainOptions |
Python | aws_cdk.aws_amplify_alpha.DomainOptions |
TypeScript (source) | @aws-cdk/aws-amplify-alpha ยป DomainOptions |
Options to add a domain to an application.
Example
declare const amplifyApp: amplify.App;
declare const main: amplify.Branch;
declare const dev: amplify.Branch;
const domain = amplifyApp.addDomain('example.com', {
enableAutoSubdomain: true, // in case subdomains should be auto registered for branches
autoSubdomainCreationPatterns: ['*', 'pr*'], // regex for branches that should auto register subdomains
});
domain.mapRoot(main); // map main branch to domain root
domain.mapSubDomain(main, 'www');
domain.mapSubDomain(dev); // sub domain prefix defaults to branch name
Properties
Name | Type | Description |
---|---|---|
auto | string[] | Branches which should automatically create subdomains. |
custom | ICertificate | The type of SSL/TLS certificate to use for your custom domain. |
domain | string | The name of the domain. |
enable | boolean | Automatically create subdomains for connected branches. |
sub | Sub [] | Subdomains. |
autoSubdomainCreationPatterns?
Type:
string[]
(optional, default: all repository branches ['', 'pr'])
Branches which should automatically create subdomains.
customCertificate?
Type:
ICertificate
(optional, default: Amplify uses the default certificate that it provisions and manages for you)
The type of SSL/TLS certificate to use for your custom domain.
domainName?
Type:
string
(optional, default: the construct's id)
The name of the domain.
enableAutoSubdomain?
Type:
boolean
(optional, default: false)
Automatically create subdomains for connected branches.
subDomains?
Type:
Sub
[]
(optional, default: use addSubDomain()
to add subdomains)
Subdomains.