Route53 / Client / get_hosted_zone

get_hosted_zone#

Route53.Client.get_hosted_zone(**kwargs)#

Gets information about a specified hosted zone including the four name servers assigned to the hosted zone.

See also: AWS API Documentation

Request Syntax

response = client.get_hosted_zone(
    Id='string'
)
Parameters:

Id (string) –

[REQUIRED]

The ID of the hosted zone that you want to get information about.

Return type:

dict

Returns:

Response Syntax

{
    'HostedZone': {
        'Id': 'string',
        'Name': 'string',
        'CallerReference': 'string',
        'Config': {
            'Comment': 'string',
            'PrivateZone': True|False
        },
        'ResourceRecordSetCount': 123,
        'LinkedService': {
            'ServicePrincipal': 'string',
            'Description': 'string'
        }
    },
    'DelegationSet': {
        'Id': 'string',
        'CallerReference': 'string',
        'NameServers': [
            'string',
        ]
    },
    'VPCs': [
        {
            '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'|'af-south-1'|'eu-south-1'|'eu-south-2'|'ap-southeast-4'|'il-central-1'|'ca-west-1',
            'VPCId': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    A complex type that contain the response to a GetHostedZone request.

    • HostedZone (dict) –

      A complex type that contains general information about the specified hosted zone.

      • Id (string) –

        The ID that Amazon Route 53 assigned to the hosted zone when you created it.

      • Name (string) –

        The name of the domain. For public hosted zones, this is the name that you have registered with your DNS registrar.

        For information about how to specify characters other than a-z, 0-9, and - (hyphen) and how to specify internationalized domain names, see CreateHostedZone.

      • CallerReference (string) –

        The value that you specified for CallerReference when you created the hosted zone.

      • Config (dict) –

        A complex type that includes the Comment and PrivateZone elements. If you omitted the HostedZoneConfig and Comment elements from the request, the Config and Comment elements don’t appear in the response.

        • Comment (string) –

          Any comments that you want to include about the hosted zone.

        • PrivateZone (boolean) –

          A value that indicates whether this is a private hosted zone.

      • ResourceRecordSetCount (integer) –

        The number of resource record sets in the hosted zone.

      • LinkedService (dict) –

        If the hosted zone was created by another service, the service that created the hosted zone. When a hosted zone is created by another service, you can’t edit or delete it using Route 53.

        • ServicePrincipal (string) –

          If the health check or hosted zone was created by another service, the service that created the resource. When a resource is created by another service, you can’t edit or delete it using Amazon Route 53.

        • Description (string) –

          If the health check or hosted zone was created by another service, an optional description that can be provided by the other service. When a resource is created by another service, you can’t edit or delete it using Amazon Route 53.

    • DelegationSet (dict) –

      A complex type that lists the Amazon Route 53 name servers for the specified hosted zone.

      • Id (string) –

        The ID that Amazon Route 53 assigns to a reusable delegation set.

      • CallerReference (string) –

        The value that you specified for CallerReference when you created the reusable delegation set.

      • NameServers (list) –

        A complex type that contains a list of the authoritative name servers for a hosted zone or for a reusable delegation set.

        • (string) –

    • VPCs (list) –

      A complex type that contains information about the VPCs that are associated with the specified hosted zone.

      • (dict) –

        (Private hosted zones only) A complex type that contains information about an Amazon VPC.

        If you associate a private hosted zone with an Amazon VPC when you make a CreateHostedZone request, the following parameters are also required.

        • VPCRegion (string) –

          (Private hosted zones only) The region that an Amazon VPC was created in.

        • VPCId (string) –

          (Private hosted zones only) The ID of an Amazon VPC.

Exceptions

  • Route53.Client.exceptions.NoSuchHostedZone

  • Route53.Client.exceptions.InvalidInput

Examples

The following example gets information about the Z3M3LMPEXAMPLE hosted zone.

response = client.get_hosted_zone(
    Id='Z3M3LMPEXAMPLE',
)

print(response)

Expected Output:

{
    'DelegationSet': {
        'NameServers': [
            'ns-2048.awsdns-64.com',
            'ns-2049.awsdns-65.net',
            'ns-2050.awsdns-66.org',
            'ns-2051.awsdns-67.co.uk',
        ],
    },
    'HostedZone': {
        'CallerReference': 'C741617D-04E4-F8DE-B9D7-0D150FC61C2E',
        'Config': {
            'PrivateZone': False,
        },
        'Id': '/hostedzone/Z3M3LMPEXAMPLE',
        'Name': 'myawsbucket.com.',
        'ResourceRecordSetCount': 8,
    },
    'ResponseMetadata': {
        '...': '...',
    },
}