Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::Route53::HostedZone

The AWS::Route53::HostedZone resource creates a hosted zone, which can contain a collection of record sets for a domain. You cannot create a hosted zone for a top-level domain (TLD). For more information, see POST CreateHostedZone or POST CreateHostedZone (Private) in the Amazon Route 53 API Reference.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

Copy
{ "Type" : "AWS::Route53::HostedZone", "Properties" : { "HostedZoneConfig" : HostedZoneConfig, "HostedZoneTags" : [ HostedZoneTags, ... ], "Name" : String, "VPCs" : [ HostedZoneVPCs, ... ] } }

YAML

Copy
Type: "AWS::Route53::HostedZone" Properties: HostedZoneConfig: HostedZoneConfig HostedZoneTags: - HostedZoneTags Name: String VPCs: - HostedZoneVPCs

Properties

HostedZoneConfig

A complex type that contains an optional comment about your hosted zone.

Required: No

Type: Amazon Route 53 HostedZoneConfig Property

Update requires: No interruption

HostedZoneTags

An arbitrary set of tags (key–value pairs) for this hosted zone.

Required: No

Type: List of Amazon Route 53 HostedZoneTags

Update requires: No interruption

Name

The name of the domain. For resource record types that include a domain name, specify a fully qualified domain name.

Required: Yes

Type: String

Update requires: Replacement

VPCs

One or more VPCs that you want to associate with this hosted zone. When you specify this property, AWS CloudFormation creates a private hosted zone.

Required: No

Type: List of Amazon Route 53 HostedZoneVPCs

If this property was specified previously and you're modifying values, updates require no interruption. If this property wasn't specified and you add values, updates require replacement. Also, if this property was specified and you remove all values, updates require replacement.

Return Values

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, Ref returns the resource name. For example:

Copy
{ "Ref": "myHostedZone" }

Ref returns the hosted zone ID, such as Z23ABC4XYZL05B.

For more information about using the Ref function, see Ref.

Fn::GetAtt

Fn::GetAtt returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

NameServers

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.

For more information about using Fn::GetAtt, see Fn::GetAtt.

Example

The following template snippet creates a private hosted zone for the example.com domain.

JSON

Copy
"DNS": { "Type": "AWS::Route53::HostedZone", "Properties": { "HostedZoneConfig": { "Comment": "My hosted zone for example.com" }, "Name": "example.com", "VPCs": [{ "VPCId": "vpc-abcd1234", "VPCRegion": "ap-northeast-1" }, { "VPCId": "vpc-efgh5678", "VPCRegion": "us-west-2" }], "HostedZoneTags" : [{ "Key": "SampleKey1", "Value": "SampleValue1" }, { "Key": "SampleKey2", "Value": "SampleValue2" }] } }

YAML

Copy
DNS: Type: "AWS::Route53::HostedZone" Properties: HostedZoneConfig: Comment: "My hosted zone for example.com" Name: "example.com" VPCs: - VPCId: "vpc-abcd1234" VPCRegion: "ap-northeast-1" - VPCId: "vpc-efgh5678" VPCRegion: "us-west-2" HostedZoneTags: - Key: "SampleKey1" Value: "SampleValue1" - Key: "SampleKey2" Value: "SampleValue2"