- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetHostedZoneCommand
Gets information about a specified hosted zone including the four name servers assigned to the hosted zone.
returns the VPCs associated with the specified hosted zone and does not reflect the VPC associations by Route 53 Profiles. To get the associations to a Profile, call the ListProfileAssociations API.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { Route53Client, GetHostedZoneCommand } from "@aws-sdk/client-route-53"; // ES Modules import
// const { Route53Client, GetHostedZoneCommand } = require("@aws-sdk/client-route-53"); // CommonJS import
const client = new Route53Client(config);
const input = { // GetHostedZoneRequest
Id: "STRING_VALUE", // required
};
const command = new GetHostedZoneCommand(input);
const response = await client.send(command);
// { // GetHostedZoneResponse
// HostedZone: { // HostedZone
// Id: "STRING_VALUE", // required
// Name: "STRING_VALUE", // required
// CallerReference: "STRING_VALUE", // required
// Config: { // HostedZoneConfig
// Comment: "STRING_VALUE",
// PrivateZone: true || false,
// },
// ResourceRecordSetCount: Number("long"),
// LinkedService: { // LinkedService
// ServicePrincipal: "STRING_VALUE",
// Description: "STRING_VALUE",
// },
// },
// DelegationSet: { // DelegationSet
// Id: "STRING_VALUE",
// CallerReference: "STRING_VALUE",
// NameServers: [ // DelegationSetNameServers // required
// "STRING_VALUE",
// ],
// },
// VPCs: [ // VPCs
// { // VPC
// VPCRegion: "us-east-1" || "us-east-2" || "us-west-1" || "us-west-2" || "eu-west-1" || "eu-west-2" || "eu-west-3" || "eu-central-1" || "eu-central-2" || "ap-east-1" || "me-south-1" || "us-gov-west-1" || "us-gov-east-1" || "us-iso-east-1" || "us-iso-west-1" || "us-isob-east-1" || "me-central-1" || "ap-southeast-1" || "ap-southeast-2" || "ap-southeast-3" || "ap-south-1" || "ap-south-2" || "ap-northeast-1" || "ap-northeast-2" || "ap-northeast-3" || "eu-north-1" || "sa-east-1" || "ca-central-1" || "cn-north-1" || "cn-northwest-1" || "af-south-1" || "eu-south-1" || "eu-south-2" || "ap-southeast-4" || "il-central-1" || "ca-west-1" || "ap-southeast-5" || "mx-central-1" || "us-isof-south-1" || "us-isof-east-1" || "ap-southeast-7",
// VPCId: "STRING_VALUE",
// },
// ],
// };
Example Usage
GetHostedZoneCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Id Required | string | undefined | The ID of the hosted zone that you want to get information about. |
GetHostedZoneCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
HostedZone Required | HostedZone | undefined | A complex type that contains general information about the specified hosted zone. |
DelegationSet | DelegationSet | undefined | A complex type that lists the Amazon Route 53 name servers for the specified hosted zone. |
VPCs | VPC[] | undefined | A complex type that contains information about the VPCs that are associated with the specified hosted zone. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidInput | client | The input is not valid. |
NoSuchHostedZone | client | No hosted zone exists with the ID that you specified. |
Route53ServiceException | Base exception class for all service exceptions from Route53 service. |