@aws-cdk/route53¶
AWS Route53 Constuct Library¶
To add a public hosted zone:
import { PublicHostedZone } from '@aws-cdk/route53';
new PublicHostedZone(this, 'HostedZone', {
zoneName: 'fully.qualified.domain.com'
});
To add a private hosted zone, use PrivateHostedZone
. Note that
enableDnsHostnames
and enableDnsSupport
must have been enabled for the
VPC you’re configuring for private hosted zones.
import { PrivateHostedZone } from '@aws-cdk/route53';
const vpc = new VpcNetwork(this, 'VPC');
const zone = new PrivateHostedZone(this, 'HostedZone', {
zoneName: 'fully.qualified.domain.com',
vpc // At least one VPC has to be added to a Private Hosted Zone.
});
Additional VPCs can be added with zone.addVPC()
.
Adding Records¶
To add a TXT record to your zone:
import { TXTRecord } from '@aws-cdk/route53';
new TXTRecord(zone, 'TXTRecord', {
recordName: '_foo', // If the name ends with a ".", it will be used as-is;
// if it ends with a "." followed by the zone name, a trailing "." will be added automatically;
// otherwise, a ".", the zone name, and a trailing "." will be added automatically.
recordValue: 'Bar!', // Will be quoted for you, and " will be escaped automatically.
ttl: 90, // Optional - default is 1800
});
Reference¶
HostedZoneId¶
HostedZoneNameServers¶
HostedZoneRef¶
-
class
_aws-cdk_route53.
HostedZoneRef
(parent, name)¶ Imported or created hosted zone
Extends: Construct
Abstract: Yes
Parameters: - parent (
Construct
) – The parent construct - name (string) –
-
static
import
(parent, name, props) → @aws-cdk/route53.HostedZoneRef¶ Parameters: - parent (
Construct
) – - name (string) –
- props (
HostedZoneRefProps
) –
Return type: HostedZoneRef
- parent (
-
export
() → @aws-cdk/route53.HostedZoneRefProps¶ Export the hosted zone
Return type: HostedZoneRefProps
-
hostedZoneId
¶ ID of this hosted zone
Type: HostedZoneId
(readonly) (abstract)
-
zoneName
¶ FQDN of this hosted zone
Type: string (readonly) (abstract)
- parent (
HostedZoneRefProps (interface)¶
ImportedHostedZone¶
-
class
_aws-cdk_route53.
ImportedHostedZone
(parent, name, props)¶ Imported hosted zone
Extends: HostedZoneRef
Parameters: - parent (
Construct
) – - name (string) –
- props (
HostedZoneRefProps
) –
-
hostedZoneId
¶ ID of this hosted zone
Type: HostedZoneId
(readonly)
-
zoneName
¶ FQDN of this hosted zone
Type: string (readonly)
- parent (
PrivateHostedZone¶
-
class
_aws-cdk_route53.
PrivateHostedZone
(parent, name, props)¶ Create a Route53 private hosted zone for use in one or more VPCs. Note that enableDnsHostnames and enableDnsSupport must have been enabled for the VPC you’re configuring for private hosted zones.
Extends: HostedZoneRef
Parameters: - parent (
Construct
) – - name (string) –
- props (
PrivateHostedZoneProps
) –
-
addVpc
(vpc)¶ Add another VPC to this private hosted zone.
Parameters: vpc ( VpcNetworkRef
) – the other VPC to add.
-
hostedZoneId
¶ Identifier of this hosted zone
Type: HostedZoneId
(readonly)
-
zoneName
¶ Fully qualified domain name for the hosted zone
Type: string (readonly)
- parent (
PrivateHostedZoneProps (interface)¶
PublicHostedZone¶
-
class
_aws-cdk_route53.
PublicHostedZone
(parent, name, props)¶ Create a Route53 public hosted zone.
Extends: HostedZoneRef
Parameters: - parent (
Construct
) – - name (string) –
- props (
PublicHostedZoneProps
) –
-
hostedZoneId
¶ Identifier of this hosted zone
Type: HostedZoneId
(readonly)
-
zoneName
¶ Fully qualified domain name for the hosted zone
Type: string (readonly)
-
nameServers
¶ Nameservers for this public hosted zone
Type: HostedZoneNameServers
(readonly)
- parent (
PublicHostedZoneProps (interface)¶
-
class
_aws-cdk_route53.
PublicHostedZoneProps
¶ Properties of a new hosted zone
-
zoneName
¶ The fully qualified domain name for the hosted zone
Type: string
-
comment
¶ Any comments that you want to include about the hosted zone.
Type: string or None
-
queryLogsLogGroupArn
¶ The Amazon Resource Name (ARN) for the log group that you want Amazon Route 53 to send query logs to.
Type: LogGroupArn
or None
-
TXTRecord¶
-
class
_aws-cdk_route53.
TXTRecord
(parent, name, props)¶ A DNS TXT record
Extends: Construct
Parameters: - parent (
HostedZoneRef
) – - name (string) –
- props (
TXTRecordProps
) –
- parent (
TXTRecordProps (interface)¶
ZoneDelegationRecord¶
-
class
_aws-cdk_route53.
ZoneDelegationRecord
(parent, name, props)¶ A record to delegate further lookups to a different set of name servers
Extends: Construct
Parameters: - parent (
HostedZoneRef
) – - name (string) –
- props (
ZoneDelegationRecordProps
) –
- parent (
ZoneDelegationRecordProps (interface)¶
-
class
_aws-cdk_route53.
ZoneDelegationRecordProps
¶ -
delegatedZoneName
¶ The name of the zone that delegation is made to.
Type: string
-
nameServers
¶ The name servers to report in the delegation records.
Type: string
-
ttl
¶ The TTL of the zone delegation records.
Type: number or None
-
comment
¶ Any comments that you want to include about the zone delegation records.
Type: string or None
-