Class CfnHostedZone
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
You create records in a public hosted zone to define how you want to route traffic on the internet for a domain, such as example.com, and its subdomains (apex.example.com, acme.example.com). You create records in a private hosted zone to define how you want to route traffic for a domain and its subdomains within one or more Amazon Virtual Private Clouds (Amazon VPCs).
You can't convert a public hosted zone to a private hosted zone or vice versa. Instead, you must create a new hosted zone with the same name and create new resource record sets.
For more information about charges for hosted zones, see Amazon Route 53 Pricing .
Note the following:
- You can't create a hosted zone for a top-level domain (TLD) such as .com.
- If your domain is registered with a registrar other than Route 53, you must update the name servers with your registrar to make Route 53 the DNS service for the domain. For more information, see Migrating DNS Service for an Existing Domain to Amazon Route 53 in the Amazon Route 53 Developer Guide .
When you submit a CreateHostedZone
request, the initial status of the hosted zone is PENDING
. For public hosted zones, this means that the NS and SOA records are not yet available on all Route 53 DNS servers. When the NS and SOA records are available, the status of the zone changes to INSYNC
.
The CreateHostedZone
request requires the caller to have an ec2:DescribeVpcs
permission.
When creating private hosted zones, the Amazon VPC must belong to the same partition where the hosted zone is created. A partition is a group of AWS Regions . Each AWS account is scoped to one partition.
The following are the supported partitions:
aws
- AWS Regionsaws-cn
- China Regionsaws-us-gov
- AWS GovCloud (US) RegionFor more information, see Access Management in the AWS General Reference .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.route53.*; CfnHostedZone cfnHostedZone = CfnHostedZone.Builder.create(this, "MyCfnHostedZone") .hostedZoneConfig(HostedZoneConfigProperty.builder() .comment("comment") .build()) .hostedZoneTags(List.of(HostedZoneTagProperty.builder() .key("key") .value("value") .build())) .name("name") .queryLoggingConfig(QueryLoggingConfigProperty.builder() .cloudWatchLogsLogGroupArn("cloudWatchLogsLogGroupArn") .build()) .vpcs(List.of(VPCProperty.builder() .vpcId("vpcId") .vpcRegion("vpcRegion") .build())) .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnHostedZone
.static interface
A complex type that contains an optional comment about your hosted zone.static interface
A complex type that contains information about a tag that you want to add or edit for the specified health check or hosted zone.static interface
A complex type that contains information about a configuration for DNS query logging.static interface
Private hosted zones only: A complex type that contains information about an Amazon VPC.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnHostedZone
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnHostedZone
(software.amazon.jsii.JsiiObjectRef objRef) CfnHostedZone
(software.constructs.Construct scope, String id) CfnHostedZone
(software.constructs.Construct scope, String id, CfnHostedZoneProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe ID that Amazon Route 53 assigned to the hosted zone when you created it.Returns the set of name servers for the specific hosted zone.A complex type that contains an optional comment.Adds, edits, or deletes tags for a health check or a hosted zone.getName()
The name of the domain.Creates a configuration for DNS query logging.getTags()
Tag Manager which manages the tags for this resource.getVpcs()
Private hosted zones: A complex type that contains information about the VPCs that are associated with the specified hosted zone.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setHostedZoneConfig
(IResolvable value) A complex type that contains an optional comment.void
A complex type that contains an optional comment.void
Adds, edits, or deletes tags for a health check or a hosted zone.void
The name of the domain.void
setQueryLoggingConfig
(IResolvable value) Creates a configuration for DNS query logging.void
Creates a configuration for DNS query logging.void
Private hosted zones: A complex type that contains information about the VPCs that are associated with the specified hosted zone.void
setVpcs
(IResolvable value) Private hosted zones: A complex type that contains information about the VPCs that are associated with the specified hosted zone.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnHostedZone
protected CfnHostedZone(software.amazon.jsii.JsiiObjectRef objRef) -
CfnHostedZone
protected CfnHostedZone(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnHostedZone
@Stability(Stable) public CfnHostedZone(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnHostedZoneProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties.
-
CfnHostedZone
@Stability(Stable) public CfnHostedZone(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrId
The ID that Amazon Route 53 assigned to the hosted zone when you created it. -
getAttrNameServers
Returns the set of name servers for the specific hosted zone. For example:ns1.example.com
.This attribute is not supported for private hosted zones.
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getHostedZoneConfig
A complex type that contains an optional comment. -
setHostedZoneConfig
A complex type that contains an optional comment. -
setHostedZoneConfig
@Stability(Stable) public void setHostedZoneConfig(@Nullable CfnHostedZone.HostedZoneConfigProperty value) A complex type that contains an optional comment. -
getHostedZoneTagsRaw
@Stability(Stable) @Nullable public List<CfnHostedZone.HostedZoneTagProperty> getHostedZoneTagsRaw()Adds, edits, or deletes tags for a health check or a hosted zone. -
setHostedZoneTagsRaw
@Stability(Stable) public void setHostedZoneTagsRaw(@Nullable List<CfnHostedZone.HostedZoneTagProperty> value) Adds, edits, or deletes tags for a health check or a hosted zone. -
getName
The name of the domain. -
setName
The name of the domain. -
getQueryLoggingConfig
Creates a configuration for DNS query logging. -
setQueryLoggingConfig
Creates a configuration for DNS query logging. -
setQueryLoggingConfig
@Stability(Stable) public void setQueryLoggingConfig(@Nullable CfnHostedZone.QueryLoggingConfigProperty value) Creates a configuration for DNS query logging. -
getVpcs
Private hosted zones: A complex type that contains information about the VPCs that are associated with the specified hosted zone. -
setVpcs
Private hosted zones: A complex type that contains information about the VPCs that are associated with the specified hosted zone. -
setVpcs
Private hosted zones: A complex type that contains information about the VPCs that are associated with the specified hosted zone.
-