@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

class _aws-cdk_route53.HostedZoneId([valueOrFunction])

Hosted zone identifier

Extends:Token
Parameters:valueOrFunction (any or None) –

HostedZoneNameServers

class _aws-cdk_route53.HostedZoneNameServers([valueOrFunction])
Extends:Token
Parameters:valueOrFunction (any or None) –

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

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)

HostedZoneRefProps (interface)

class _aws-cdk_route53.HostedZoneRefProps

Reference to a hosted zone

hostedZoneId

Identifier of the hosted zone

Type:HostedZoneId
zoneName

Name of the hosted zone

Type:string

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)

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)

PrivateHostedZoneProps (interface)

class _aws-cdk_route53.PrivateHostedZoneProps

Properties for a private hosted zone.

Extends:PublicHostedZoneProps
vpc

One VPC that you want to associate with this hosted zone.

Type:VpcNetworkRef

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)

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) –

TXTRecordProps (interface)

class _aws-cdk_route53.TXTRecordProps
recordName
Type:string
recordValue
Type:string
ttl
Type:number or None

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) –

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