AWS Route 53 Zone
This page shows how to write Terraform and CloudFormation for Route 53 Zone and write them securely.
aws_route53_zone (Terraform)
The Zone in Route 53 can be configured in Terraform with the resource name aws_route53_zone
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_route53_zone" "dotmedia" {
name = "infectious.media"
}
resource "aws_route53_zone" "mediafr" {
name = "infectiousmedia.fr"
resource "aws_route53_zone" "dotmedia" {
name = "infectious.media"
}
resource "aws_route53_zone" "mediafr" {
name = "infectiousmedia.fr"
resource "aws_route53_zone" "beryju-org" {
name = "beryju.org"
}
resource "aws_route53_zone" "jela-io" {
name = "jela.io"
resource "aws_route53_zone" "holepunch" {
name = "holepunch.io"
}
resource "aws_route53_zone" "hole_ly" {
name = "hole.ly"
resource "aws_route53_zone" "public" {
name = var.domain
comment = var.prefix
tags = merge(
var.tags,
Parameters
-
comment
optional - string -
delegation_set_id
optional - string -
force_destroy
optional - bool -
id
optional computed - string -
name
required - string -
name_servers
optional computed - list of string -
tags
optional - map from string to string -
zone_id
optional computed - string -
vpc
set block-
vpc_id
required - string -
vpc_region
optional computed - string
-
Explanation in Terraform Registry
Manages a Route53 Hosted Zone. For managing Domain Name System Security Extensions (DNSSEC), see the
aws_route53_key_signing_key
andaws_route53_hosted_zone_dnssec
resources.
AWS::Route53::HostedZone (CloudFormation)
The HostedZone in Route53 can be configured in CloudFormation with the resource name AWS::Route53::HostedZone
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: "AWS::Route53::HostedZone"
reckerfamilycom:
DeletionPolicy: Retain
Properties:
Name: "reckerfamily.com."
Type: "AWS::Route53::HostedZone"
Type: "AWS::Route53::HostedZone"
Properties:
HostedZoneConfig:
Comment: !Sub "Created by CloudFormation stack: ${AWS::StackName}"
Name: suggpro.fr
DeletionPolicy: Delete
Type: AWS::Route53::HostedZone
Properties:
HostedZoneConfig:
Comment:
Fn::Join:
- ''
Type: AWS::Route53::HostedZone
Properties:
HostedZoneConfig:
Comment:
Fn::Join:
- ''
# Type: AWS::Route53::HostedZone::Id
# Description: An Amazon Route 53 hosted zone ID
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
"Type" : "AWS::Route53::HostedZone",
"Properties" : {
"Name" : "dirtybit.io" }
},
"dirtybitnl": {
"Type" : "AWS::Route53::HostedZone",
"resourceType" : "AWS::Route53::HostedZone",
"properties" : [ {
"propertyName" : "HostedZoneConfig",
"propertyType" : "AWS::Route53::HostedZone::HostedZoneConfig",
"required" : false,
"propertyHref" : "aws-properties-route53-hostedzone-hostedzoneconfig.html"
"Type": "AWS::Route53::HostedZone",
"Properties": {
"Name": "myzone.com."
}
},
"ParentHostedZoneCrossAccountZoneDelegationRole95B1C36E": {
"Type": "AWS::Route53::HostedZone",
"Properties": {
"Name": "cdk.local.",
"VPCs": [
{
"VPCId": {
"Type": "AWS::Route53::HostedZone",
"Properties": {
"Name": "cdk.local.",
"VPCs": [
{
"VPCId": {
Parameters
-
HostedZoneConfig
optional - HostedZoneConfig -
HostedZoneTags
optional - List of HostedZoneTag -
Name
required - String -
QueryLoggingConfig
optional - QueryLoggingConfig -
VPCs
optional - List of VPC
Explanation in CloudFormation Registry
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). Important 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.
For public hosted zones, Route 53 automatically creates a default SOA record and four NS records for the zone. For more information about SOA and NS records, see NS and SOA Records that Route 53 Creates for a Hosted Zone in the Amazon Route 53 Developer Guide. If you want to use the same name servers for multiple public hosted zones, you can optionally associate a reusable delegation set with the hosted zone. See the
DelegationSetId
element.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 isPENDING
. 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 toINSYNC
.The
CreateHostedZone
request requires the caller to have anec2:DescribeVpcs
permission.
Frequently asked questions
What is AWS Route 53 Zone?
AWS Route 53 Zone is a resource for Route 53 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Route 53 Zone?
For Terraform, the max-l-weaver/route52_dyn_terraform, max-l-weaver/terraform_route53_dyn and BeryJu/infrastructure source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the arecker/infra, Benjamin-99/Webapp and vincentjorgensen/jib source code examples are useful. See the CloudFormation Example section for further details.