hostedZoneId property

String hostedZoneId
final

Alias resource records sets only: The value used depends on where you want to route traffic:

Amazon API Gateway custom regional APIs and edge-optimized APIs
Specify the hosted zone ID for your API. You can get the applicable value using the AWS CLI command get-domain-names:
  • For regional APIs, specify the value of regionalHostedZoneId.
  • For edge-optimized APIs, specify the value of distributionHostedZoneId.
Amazon Virtual Private Cloud interface VPC endpoint
Specify the hosted zone ID for your interface endpoint. You can get the value of HostedZoneId using the AWS CLI command describe-vpc-endpoints.
CloudFront distribution
Specify Z2FDTNDATAQYW2.
Elastic Beanstalk environment
Specify the hosted zone ID for the region that you created the environment in. The environment must have a regionalized subdomain. For a list of regions and the corresponding hosted zone IDs, see AWS Elastic Beanstalk in the "AWS Service Endpoints" chapter of the Amazon Web Services General Reference.
ELB load balancer
Specify the value of the hosted zone ID for the load balancer. Use the following methods to get the hosted zone ID:
  • Service Endpoints table in the "Elastic Load Balancing Endpoints and Quotas" topic in the Amazon Web Services General Reference: Use the value that corresponds with the region that you created your load balancer in. Note that there are separate columns for Application and Classic Load Balancers and for Network Load Balancers.
  • AWS Management Console: Go to the Amazon EC2 page, choose Load Balancers in the navigation pane, select the load balancer, and get the value of the Hosted zone field on the Description tab.
  • Elastic Load Balancing API: Use DescribeLoadBalancers to get the applicable value. For more information, see the applicable guide:
  • AWS CLI: Use describe-load-balancers to get the applicable value. For more information, see the applicable guide:
AWS Global Accelerator accelerator
Specify Z2BJ6XQ5FK7U4H.
An Amazon S3 bucket configured as a static website
Specify the hosted zone ID for the region that you created the bucket in. For more information about valid values, see the table Amazon S3 Website Endpoints in the Amazon Web Services General Reference.
Another Route 53 resource record set in your hosted zone
Specify the hosted zone ID of your hosted zone. (An alias resource record set can't reference a resource record set in a different hosted zone.)

Implementation

final String hostedZoneId;