- Implements: IDomain
import { Domain } from '@alma-cdk/domain'
new Domain(scope: Construct, id: string, props: DomainProps)| Name | Type | Description |
|---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
DomainProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: DomainProps
| Name | Description |
|---|---|
toString |
Returns a string representation of this construct. |
addTarget |
Assign an alias as record target with the fully-qualified domain name. |
configureCloudFront |
Helper method to configure CloudFront distribution with the domain, certificate and IPv6 support. |
public toString(): stringReturns a string representation of this construct.
public addTarget(alias: IAliasRecordTarget): voidAssign an alias as record target with the fully-qualified domain name.
This will create both A & AAAA DNS records, unless disableIpV6 was set to true
during initialization of Domain construct (resulting in only A record being created).
Example
domain.addTarget(new targets.CloudFrontTarget(distribution))- Type: aws-cdk-lib.aws_route53.IAliasRecordTarget
Route53 alias record target used to assign as A/AAAA record value.
public configureCloudFront(): ICloudFrontConfigurationHelper method to configure CloudFront distribution with the domain, certificate and IPv6 support.
| Name | Description |
|---|---|
isConstruct |
Checks if x is a construct. |
import { Domain } from '@alma-cdk/domain'
Domain.isConstruct(x: any)Checks if x is a construct.
- Type: any
Any object.
| Name | Type | Description |
|---|---|---|
node |
constructs.Node |
The tree node. |
certificate |
aws-cdk-lib.aws_certificatemanager.ICertificate |
Certificate Manager certificate. |
enableIpv6 |
boolean |
Has IPv6 AAAA records been created. |
fqdn |
string |
Fully-qualified domain name. |
zone |
aws-cdk-lib.aws_route53.IHostedZone |
Route53 hosted zone used to assign the domain into. |
public readonly node: Node;- Type: constructs.Node
The tree node.
public readonly certificate: ICertificate;- Type: aws-cdk-lib.aws_certificatemanager.ICertificate
Certificate Manager certificate.
public readonly enableIpv6: boolean;- Type: boolean
Has IPv6 AAAA records been created.
Can be used to conditionally configure IPv6 support to CloudFront distribution.
public readonly fqdn: string;- Type: string
Fully-qualified domain name.
public readonly zone: IHostedZone;- Type: aws-cdk-lib.aws_route53.IHostedZone
Route53 hosted zone used to assign the domain into.
Properties to configure the domain (zone and certificate).
import { DomainProps } from '@alma-cdk/domain'
const domainProps: DomainProps = { ... }| Name | Type | Description |
|---|---|---|
zone |
string | aws-cdk-lib.aws_route53.IHostedZone |
Provide either a fully-qualified domain name as string to perform a hosted zone lookup or a previously defined hosted zone as route53.IHostedZone. |
certificate |
aws-cdk-lib.aws_certificatemanager.ICertificate |
Provide your own pre-existing certificate. |
enableIpv6 |
boolean |
Set to false to disable IPv6 AAAA record creation. |
region |
string |
AWS Region to deploy the certificate into. |
subdomain |
string |
Provide subdomain or leave undefined to use the zone apex domain. |
public readonly zone: string | IHostedZone;- Type: string | aws-cdk-lib.aws_route53.IHostedZone
Provide either a fully-qualified domain name as string to perform a hosted zone lookup or a previously defined hosted zone as route53.IHostedZone.
public readonly certificate: ICertificate;- Type: aws-cdk-lib.aws_certificatemanager.ICertificate
Provide your own pre-existing certificate.
If not provided, a new certificate will be created by default.
public readonly enableIpv6: boolean;- Type: boolean
- Default: true
Set to false to disable IPv6 AAAA record creation.
public readonly region: string;- Type: string
- Default: "us-east-1"
AWS Region to deploy the certificate into.
Defaults to us-east-1 which is the only region where
ACM certificates can be deployed to CloudFront.
public readonly subdomain: string;- Type: string
Provide subdomain or leave undefined to use the zone apex domain.
If subdomain provided, the resulting FQDN will be subdomain.zone.
- Implemented By: ICloudFrontConfiguration
| Name | Type | Description |
|---|---|---|
certificate |
aws-cdk-lib.aws_certificatemanager.ICertificate |
Certificate Manager certificate. |
domainNames |
string[] |
Alternative domain names for this distribution. |
enableIpv6 |
boolean |
Has IPv6 AAAA records been created. |
public readonly certificate: ICertificate;- Type: aws-cdk-lib.aws_certificatemanager.ICertificate
Certificate Manager certificate.
public readonly domainNames: string[];- Type: string[]
Alternative domain names for this distribution.
public readonly enableIpv6: boolean;- Type: boolean
Has IPv6 AAAA records been created.
Can be used to conditionally configure IPv6 support to CloudFront distribution.
Interface contract implemented by Domain construct.
| Name | Description |
|---|---|
addTarget |
Assign an alias as record target with the fully-qualified domain name. |
public addTarget(alias: IAliasRecordTarget): voidAssign an alias as record target with the fully-qualified domain name.
This will create both A & AAAA DNS records, unless disableIpV6 was set to true
during initialization of Domain construct (resulting in only A record being created).
Example
domain.addTarget(new targets.CloudFrontTarget(distribution))- Type: aws-cdk-lib.aws_route53.IAliasRecordTarget
Route53 alias record target used to assign as A/AAAA record value.
| Name | Type | Description |
|---|---|---|
certificate |
aws-cdk-lib.aws_certificatemanager.ICertificate |
Certificate Manager certificate. |
enableIpv6 |
boolean |
Has IPv6 AAAA records been created. |
fqdn |
string |
Fully-qualified domain name. |
zone |
aws-cdk-lib.aws_route53.IHostedZone |
Route53 hosted zone used to assign the domain into. |
public readonly certificate: ICertificate;- Type: aws-cdk-lib.aws_certificatemanager.ICertificate
Certificate Manager certificate.
public readonly enableIpv6: boolean;- Type: boolean
Has IPv6 AAAA records been created.
Can be used to conditionally configure IPv6 support to CloudFront distribution.
public readonly fqdn: string;- Type: string
Fully-qualified domain name.
public readonly zone: IHostedZone;- Type: aws-cdk-lib.aws_route53.IHostedZone
Route53 hosted zone used to assign the domain into.