awscc_route53_hosted_zone (Resource)

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 General Reference.

Example Usage

Route53 Hosted Zone

To create public awscc_route53_hosted_zone use below:

resource "awscc_route53_hosted_zone" "this" {
  name = "this.com"
  hosted_zone_tags = [
    {
      key   = "Name"
      value = "this"
    },
    {
      key   = "Modified By"
      value = "AWSCC"
    }
  ]
}

To create a private awscc_route53_hosted_zone use below:

resource "awscc_route53_hosted_zone" "this" {
  name = "this.com"
  hosted_zone_tags = [
    {
      key   = "Name"
      value = "this"
    },
    {
      key   = "Modified By"
      value = "AWSCC"
    }
  ]
  vp_cs = [
    {
      vpc_id     = awscc_ec2_vpc.main.id
      vpc_region = "us-east-1"
    }
  ]
}

resource "awscc_ec2_vpc" "main" {
  cidr_block = "10.0.0.0/16"
}

Schema

Optional

Read-Only

Nested Schema for hosted_zone_config

Optional:

Nested Schema for hosted_zone_tags

Required:

Nested Schema for query_logging_config

Required:

Nested Schema for vp_cs

Required:

Import

Import is supported using the following syntax:

$ terraform import awscc_route53_hosted_zone.example <resource ID>