PrivateHostedZone

class aws_cdk.aws_route53.PrivateHostedZone(scope, id, *, vpc, zone_name, comment=None, query_logs_log_group_arn=None)

Bases: aws_cdk.aws_route53.HostedZone

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.

Resource

AWS::Route53::HostedZone

Parameters
  • scope (Construct) –

  • id (str) –

  • vpc (IVpc) – A VPC that you want to associate with this hosted zone. Private hosted zones must be associated with at least one VPC. You can associated additional VPCs using addVpc(vpc).

  • zone_name (str) – The name of the domain. For resource record types that include a domain name, specify a fully qualified domain name.

  • comment (Optional[str]) – Any comments that you want to include about the hosted zone. Default: none

  • query_logs_log_group_arn (Optional[str]) – The Amazon Resource Name (ARN) for the log group that you want Amazon Route 53 to send query logs to. Default: disabled

Methods

add_vpc(vpc)

Add another VPC to this private hosted zone.

Parameters

vpc (IVpc) – the other VPC to add.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

hosted_zone_arn

route53:::hostedzone/${Id}.

Type

ARN of this hosted zone, such as arn

Type

${Partition}

Return type

str

hosted_zone_id

ID of this hosted zone, such as “Z23ABC4XYZL05B”.

Return type

str

hosted_zone_name_servers

ns1.example.com.

This attribute will be undefined for private hosted zones or hosted zones imported from another stack.

Type

Returns the set of name servers for the specific hosted zone. For example

Return type

Optional[List[str]]

node

The construct tree node associated with this construct.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

zone_name

FQDN of this hosted zone.

Return type

str

Static Methods

classmethod from_hosted_zone_attributes(scope, id, *, hosted_zone_id, zone_name)

Imports a hosted zone from another stack.

Use when both hosted zone ID and hosted zone name are known.

Parameters
  • scope (Construct) – the parent Construct for this Construct.

  • id (str) – the logical name of this Construct.

  • hosted_zone_id (str) – Identifier of the hosted zone.

  • zone_name (str) – Name of the hosted zone.

Return type

IHostedZone

classmethod from_hosted_zone_id(scope, id, hosted_zone_id)

Import a Route 53 hosted zone defined either outside the CDK, or in a different CDK stack.

Use when hosted zone ID is known. Hosted zone name becomes unavailable through this query.

Parameters
  • scope (Construct) – the parent Construct for this Construct.

  • id (str) – the logical name of this Construct.

  • hosted_zone_id (str) – the ID of the hosted zone to import.

Return type

IHostedZone

classmethod from_lookup(scope, id, *, domain_name, private_zone=None, vpc_id=None)

Lookup a hosted zone in the current account/region based on query parameters.

Requires environment, you must specify env for the stack.

Use to easily query hosted zones.

Parameters
  • scope (Construct) –

  • id (str) –

  • domain_name (str) – The zone domain e.g. example.com.

  • private_zone (Optional[bool]) – Whether the zone that is being looked up is a private hosted zone. Default: false

  • vpc_id (Optional[str]) – 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 Default: - No VPC ID

See

https://docs.aws.amazon.com/cdk/latest/guide/environments.html

Return type

IHostedZone

classmethod from_private_hosted_zone_id(scope, id, private_hosted_zone_id)

Import a Route 53 private hosted zone defined either outside the CDK, or in a different CDK stack.

Parameters
  • scope (Construct) – the parent Construct for this Construct.

  • id (str) – the logical name of this Construct.

  • private_hosted_zone_id (str) – the ID of the private hosted zone to import.

Return type

IPrivateHostedZone

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool