github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/aws/r/route53_zone.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_route53_zone"
     4  sidebar_current: "docs-aws-resource-route53-zone"
     5  description: |-
     6    Provides a Route53 Hosted Zone resource.
     7  ---
     8  
     9  # aws\_route53\_zone
    10  
    11  Provides a Route53 Hosted Zone resource.
    12  
    13  ## Example Usage
    14  
    15  ```hcl
    16  resource "aws_route53_zone" "primary" {
    17    name = "example.com"
    18  }
    19  ```
    20  
    21  For use in subdomains, note that you need to create a
    22  `aws_route53_record` of type `NS` as well as the subdomain
    23  zone.
    24  
    25  ```hcl
    26  resource "aws_route53_zone" "main" {
    27    name = "example.com"
    28  }
    29  
    30  resource "aws_route53_zone" "dev" {
    31    name = "dev.example.com"
    32  
    33    tags {
    34      Environment = "dev"
    35    }
    36  }
    37  
    38  resource "aws_route53_record" "dev-ns" {
    39    zone_id = "${aws_route53_zone.main.zone_id}"
    40    name    = "dev.example.com"
    41    type    = "NS"
    42    ttl     = "30"
    43  
    44    records = [
    45      "${aws_route53_zone.dev.name_servers.0}",
    46      "${aws_route53_zone.dev.name_servers.1}",
    47      "${aws_route53_zone.dev.name_servers.2}",
    48      "${aws_route53_zone.dev.name_servers.3}",
    49    ]
    50  }
    51  ```
    52  
    53  ## Argument Reference
    54  
    55  The following arguments are supported:
    56  
    57  * `name` - (Required) This is the name of the hosted zone.
    58  * `comment` - (Optional) A comment for the hosted zone. Defaults to 'Managed by Terraform'.
    59  * `tags` - (Optional) A mapping of tags to assign to the zone.
    60  * `vpc_id` - (Optional) The VPC to associate with a private hosted zone. Specifying `vpc_id` will create a private hosted zone.
    61    Conflicts w/ `delegation_set_id` as delegation sets can only be used for public zones.
    62  * `vpc_region` - (Optional) The VPC's region. Defaults to the region of the AWS provider.
    63  * `delegation_set_id` - (Optional) The ID of the reusable delegation set whose NS records you want to assign to the hosted zone.
    64    Conflicts w/ `vpc_id` as delegation sets can only be used for public zones.
    65  * `force_destroy` - (Optional) Whether to destroy all records (possibly managed outside of Terraform)
    66    in the zone when destroying the zone.
    67  
    68  ## Attributes Reference
    69  
    70  The following attributes are exported:
    71  
    72  * `zone_id` - The Hosted Zone ID. This can be referenced by zone records.
    73  * `name_servers` - A list of name servers in associated (or default) delegation set.
    74    Find more about delegation sets in [AWS docs](https://docs.aws.amazon.com/Route53/latest/APIReference/actions-on-reusable-delegation-sets.html).
    75  
    76  
    77  ## Import
    78  
    79  Route53 Zones can be imported using the `zone id`, e.g.
    80  
    81  ```
    82  $ terraform import aws_route53_zone.myzone Z1D633PJN98FT9
    83  ```