@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:45.952Z") public class CfnHostedZone extends CfnResource implements IInspectable
Creates a new public or private hosted zone. 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:
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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnHostedZone.Builder
A fluent builder for
CfnHostedZone . |
static interface |
CfnHostedZone.HostedZoneConfigProperty
A complex type that contains an optional comment about your hosted zone.
|
static interface |
CfnHostedZone.HostedZoneTagProperty
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 |
CfnHostedZone.QueryLoggingConfigProperty
A complex type that contains information about a configuration for DNS query logging.
|
static interface |
CfnHostedZone.VPCProperty
*Private hosted zones only:* A complex type that contains information about an Amazon VPC.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnHostedZone(Construct scope,
java.lang.String id)
Create a new `AWS::Route53::HostedZone`.
|
|
CfnHostedZone(Construct scope,
java.lang.String id,
CfnHostedZoneProps props)
Create a new `AWS::Route53::HostedZone`.
|
protected |
CfnHostedZone(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnHostedZone(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrId()
The ID that Amazon Route 53 assigned to the hosted zone when you created it.
|
java.util.List<java.lang.String> |
getAttrNameServers()
Returns the set of name servers for the specific hosted zone.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.Object |
getHostedZoneConfig()
A complex type that contains an optional comment.
|
java.lang.String |
getName()
The name of the domain.
|
java.lang.Object |
getQueryLoggingConfig()
Creates a configuration for DNS query logging.
|
TagManager |
getTags()
Adds, edits, or deletes tags for a health check or a hosted zone.
|
java.lang.Object |
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.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setHostedZoneConfig(CfnHostedZone.HostedZoneConfigProperty value)
A complex type that contains an optional comment.
|
void |
setHostedZoneConfig(IResolvable value)
A complex type that contains an optional comment.
|
void |
setName(java.lang.String value)
The name of the domain.
|
void |
setQueryLoggingConfig(CfnHostedZone.QueryLoggingConfigProperty value)
Creates a configuration for DNS query logging.
|
void |
setQueryLoggingConfig(IResolvable value)
Creates a configuration for DNS query logging.
|
void |
setVpcs(IResolvable value)
*Private hosted zones:* A complex type that contains information about the VPCs that are associated with the specified hosted zone.
|
void |
setVpcs(java.util.List<java.lang.Object> value)
*Private hosted zones:* A complex type that contains information about the VPCs that are associated with the specified hosted zone.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnHostedZone(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnHostedZone(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnHostedZone(Construct scope, java.lang.String id, CfnHostedZoneProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties.public CfnHostedZone(Construct scope, java.lang.String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrId()
public java.util.List<java.lang.String> getAttrNameServers()
This attribute is not supported for private hosted zones.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
For information about using tags for cost allocation, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide .
public java.lang.Object getHostedZoneConfig()
If you don't want to specify a comment, omit the HostedZoneConfig
and Comment
elements.
public void setHostedZoneConfig(IResolvable value)
If you don't want to specify a comment, omit the HostedZoneConfig
and Comment
elements.
public void setHostedZoneConfig(CfnHostedZone.HostedZoneConfigProperty value)
If you don't want to specify a comment, omit the HostedZoneConfig
and Comment
elements.
public java.lang.String getName()
Specify a fully qualified domain name, for example, www.example.com . The trailing dot is optional; Amazon Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.
If you're creating a public hosted zone, this is the name you have registered with your DNS registrar. If your domain name is registered with a registrar other than Route 53, change the name servers for your domain to the set of NameServers
that are returned by the Fn::GetAtt
intrinsic function.
public void setName(java.lang.String value)
Specify a fully qualified domain name, for example, www.example.com . The trailing dot is optional; Amazon Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.
If you're creating a public hosted zone, this is the name you have registered with your DNS registrar. If your domain name is registered with a registrar other than Route 53, change the name servers for your domain to the set of NameServers
that are returned by the Fn::GetAtt
intrinsic function.
public java.lang.Object getQueryLoggingConfig()
After you create a query logging configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch Logs log group.
DNS query logs contain information about the queries that Route 53 receives for a specified public hosted zone, such as the following:
NoError
or ServFail
If you create a query logging configuration using the Route 53 console, Route 53 performs these operations automatically.
/aws/route53/ *hosted zone name*
In the next step, you'll create a resource policy, which controls access to one or more log groups and the associated AWS resources, such as Route 53 hosted zones. There's a limit on the number of resource policies that you can create, so we recommend that you use a consistent prefix so you can use the same resource policy for all the log groups that you create for query logging.
Resource
, specify the ARN for the log group that you created in the previous step. To use the same resource policy for all the CloudWatch Logs log groups that you created for query logging configurations, replace the hosted zone name with *
, for example:
arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/*
To avoid the confused deputy problem, a security issue where an entity without a permission for an action can coerce a more-privileged entity to perform it, you can optionally limit the permissions that a service has to a resource in a resource-based policy by supplying the following values:
aws:SourceArn
, supply the hosted zone ARN used in creating the query logging configuration. For example, aws:SourceArn: arn:aws:route53:::hostedzone/hosted zone ID
.aws:SourceAccount
, supply the account ID for the account that creates the query logging configuration. For example, aws:SourceAccount:111111111111
.For more information, see The confused deputy problem in the AWS IAM User Guide .
You can't use the CloudWatch console to create or edit a resource policy. You must use the CloudWatch API, one of the AWS SDKs, or the AWS CLI .
The name of each log stream is in the following format:
*hosted zone ID* / *edge location code*
The edge location code is a three-letter code and an arbitrarily assigned number, for example, DFW3. The three-letter code typically corresponds with the International Air Transport Association airport code for an airport near the edge location. (These abbreviations might change in the future.) For a list of edge locations, see "The Route 53 Global Network" on the Route 53 Product Details page.
public void setQueryLoggingConfig(IResolvable value)
After you create a query logging configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch Logs log group.
DNS query logs contain information about the queries that Route 53 receives for a specified public hosted zone, such as the following:
NoError
or ServFail
If you create a query logging configuration using the Route 53 console, Route 53 performs these operations automatically.
/aws/route53/ *hosted zone name*
In the next step, you'll create a resource policy, which controls access to one or more log groups and the associated AWS resources, such as Route 53 hosted zones. There's a limit on the number of resource policies that you can create, so we recommend that you use a consistent prefix so you can use the same resource policy for all the log groups that you create for query logging.
Resource
, specify the ARN for the log group that you created in the previous step. To use the same resource policy for all the CloudWatch Logs log groups that you created for query logging configurations, replace the hosted zone name with *
, for example:
arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/*
To avoid the confused deputy problem, a security issue where an entity without a permission for an action can coerce a more-privileged entity to perform it, you can optionally limit the permissions that a service has to a resource in a resource-based policy by supplying the following values:
aws:SourceArn
, supply the hosted zone ARN used in creating the query logging configuration. For example, aws:SourceArn: arn:aws:route53:::hostedzone/hosted zone ID
.aws:SourceAccount
, supply the account ID for the account that creates the query logging configuration. For example, aws:SourceAccount:111111111111
.For more information, see The confused deputy problem in the AWS IAM User Guide .
You can't use the CloudWatch console to create or edit a resource policy. You must use the CloudWatch API, one of the AWS SDKs, or the AWS CLI .
The name of each log stream is in the following format:
*hosted zone ID* / *edge location code*
The edge location code is a three-letter code and an arbitrarily assigned number, for example, DFW3. The three-letter code typically corresponds with the International Air Transport Association airport code for an airport near the edge location. (These abbreviations might change in the future.) For a list of edge locations, see "The Route 53 Global Network" on the Route 53 Product Details page.
public void setQueryLoggingConfig(CfnHostedZone.QueryLoggingConfigProperty value)
After you create a query logging configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch Logs log group.
DNS query logs contain information about the queries that Route 53 receives for a specified public hosted zone, such as the following:
NoError
or ServFail
If you create a query logging configuration using the Route 53 console, Route 53 performs these operations automatically.
/aws/route53/ *hosted zone name*
In the next step, you'll create a resource policy, which controls access to one or more log groups and the associated AWS resources, such as Route 53 hosted zones. There's a limit on the number of resource policies that you can create, so we recommend that you use a consistent prefix so you can use the same resource policy for all the log groups that you create for query logging.
Resource
, specify the ARN for the log group that you created in the previous step. To use the same resource policy for all the CloudWatch Logs log groups that you created for query logging configurations, replace the hosted zone name with *
, for example:
arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/*
To avoid the confused deputy problem, a security issue where an entity without a permission for an action can coerce a more-privileged entity to perform it, you can optionally limit the permissions that a service has to a resource in a resource-based policy by supplying the following values:
aws:SourceArn
, supply the hosted zone ARN used in creating the query logging configuration. For example, aws:SourceArn: arn:aws:route53:::hostedzone/hosted zone ID
.aws:SourceAccount
, supply the account ID for the account that creates the query logging configuration. For example, aws:SourceAccount:111111111111
.For more information, see The confused deputy problem in the AWS IAM User Guide .
You can't use the CloudWatch console to create or edit a resource policy. You must use the CloudWatch API, one of the AWS SDKs, or the AWS CLI .
The name of each log stream is in the following format:
*hosted zone ID* / *edge location code*
The edge location code is a three-letter code and an arbitrarily assigned number, for example, DFW3. The three-letter code typically corresponds with the International Air Transport Association airport code for an airport near the edge location. (These abbreviations might change in the future.) For a list of edge locations, see "The Route 53 Global Network" on the Route 53 Product Details page.
public java.lang.Object getVpcs()
For public hosted zones, omit
VPCs
,VPCId
, andVPCRegion
.
public void setVpcs(IResolvable value)
For public hosted zones, omit
VPCs
,VPCId
, andVPCRegion
.
public void setVpcs(java.util.List<java.lang.Object> value)
For public hosted zones, omit
VPCs
,VPCId
, andVPCRegion
.