aws-cdk-lib.aws_route53.HostedZoneProviderProps

interface HostedZoneProviderProps

LanguageType name
.NETAmazon.CDK.AWS.Route53.HostedZoneProviderProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsroute53#HostedZoneProviderProps
Javasoftware.amazon.awscdk.services.route53.HostedZoneProviderProps
Pythonaws_cdk.aws_route53.HostedZoneProviderProps
TypeScript (source)aws-cdk-lib » aws_route53 » HostedZoneProviderProps

Zone properties for looking up the Hosted Zone.

Example

import * as s3 from 'aws-cdk-lib/aws-s3';

const recordName = 'www';
const domainName = 'example.com';

const bucketWebsite = new s3.Bucket(this, 'BucketWebsite', {
  bucketName: [recordName, domainName].join('.'), // www.example.com
  publicReadAccess: true,
  websiteIndexDocument: 'index.html',
});

const zone = route53.HostedZone.fromLookup(this, 'Zone', {domainName}); // example.com

new route53.ARecord(this, 'AliasRecord', {
  zone,
  recordName, // www
  target: route53.RecordTarget.fromAlias(new targets.BucketWebsiteTarget(bucketWebsite)),
});

Properties

NameTypeDescription
domainNamestringThe zone domain e.g. example.com.
privateZone?booleanWhether the zone that is being looked up is a private hosted zone.
vpcId?stringSpecifies the ID of the VPC associated with a private hosted zone.

domainName

Type: string

The zone domain e.g. example.com.


privateZone?

Type: boolean (optional, default: false)

Whether the zone that is being looked up is a private hosted zone.


vpcId?

Type: string (optional, default: No VPC ID)

Specifies the ID of the VPC associated with a private hosted zone.

If a VPC ID is provided and privateZone is false, no results will be returned and an error will be raised