Class CfnHostedZone
A CloudFormation AWS::Route53::HostedZone
.
Inherited Members
Namespace: Amazon.CDK.AWS.Route53
Assembly: Amazon.CDK.AWS.Route53.dll
Syntax (csharp)
public class CfnHostedZone : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnHostedZone
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
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:
For more information, see Access Management in the AWS General Reference .
CloudformationResource: AWS::Route53::HostedZone
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53-hostedzone.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Route53;
var cfnHostedZone = new CfnHostedZone(this, "MyCfnHostedZone", new CfnHostedZoneProps {
HostedZoneConfig = new HostedZoneConfigProperty {
Comment = "comment"
},
HostedZoneTags = new [] { new HostedZoneTagProperty {
Key = "key",
Value = "value"
} },
Name = "name",
QueryLoggingConfig = new QueryLoggingConfigProperty {
CloudWatchLogsLogGroupArn = "cloudWatchLogsLogGroupArn"
},
Vpcs = new [] { new VPCProperty {
VpcId = "vpcId",
VpcRegion = "vpcRegion"
} }
});
Synopsis
Constructors
CfnHostedZone(Construct, String, ICfnHostedZoneProps) | Create a new |
CfnHostedZone(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnHostedZone(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrId | The ID that Amazon Route 53 assigned to the hosted zone when you created it. |
AttrNameServers | Returns the set of name servers for the specific hosted zone. For example: |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
HostedZoneConfig | A complex type that contains an optional comment. |
Name | The name of the domain. |
QueryLoggingConfig | Creates a configuration for DNS query logging. |
Tags | Adds, edits, or deletes tags for a health check or a hosted zone. |
Vpcs | Private hosted zones: A complex type that contains information about the VPCs that are associated with the specified hosted zone. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnHostedZone(Construct, String, ICfnHostedZoneProps)
Create a new AWS::Route53::HostedZone
.
public CfnHostedZone(Construct scope, string id, ICfnHostedZoneProps props = null)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnHostedZoneProps
- resource properties.
CfnHostedZone(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnHostedZone(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnHostedZone(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnHostedZone(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrId
The ID that Amazon Route 53 assigned to the hosted zone when you created it.
public virtual string AttrId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Id
AttrNameServers
Returns the set of name servers for the specific hosted zone. For example: ns1.example.com
.
public virtual string[] AttrNameServers { get; }
Property Value
System.String[]
Remarks
This attribute is not supported for private hosted zones.
CloudformationAttribute: NameServers
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
HostedZoneConfig
A complex type that contains an optional comment.
public virtual object HostedZoneConfig { get; set; }
Property Value
System.Object
Remarks
If you don't want to specify a comment, omit the HostedZoneConfig
and Comment
elements.
Name
The name of the domain.
public virtual string Name { get; set; }
Property Value
System.String
Remarks
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.
QueryLoggingConfig
Creates a configuration for DNS query logging.
public virtual object QueryLoggingConfig { get; set; }
Property Value
System.Object
Remarks
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:
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.
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:
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.
Tags
Adds, edits, or deletes tags for a health check or a hosted zone.
public virtual TagManager Tags { get; }
Property Value
Remarks
For information about using tags for cost allocation, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide .
Vpcs
Private hosted zones: A complex type that contains information about the VPCs that are associated with the specified hosted zone.
public virtual object Vpcs { get; set; }
Property Value
System.Object
Remarks
For public hosted zones, omit VPCs
, VPCId
, and VPCRegion
.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>