github.com/ves/terraform@v0.8.0-beta2/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  ```
    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  ```
    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.dev.zone_id}"
    40      name = "dev.example.com"
    41      type = "NS"
    42      ttl = "30"
    43      records = [
    44          "${aws_route53_zone.dev.name_servers.0}",
    45          "${aws_route53_zone.dev.name_servers.1}",
    46          "${aws_route53_zone.dev.name_servers.2}",
    47          "${aws_route53_zone.dev.name_servers.3}"
    48      ]
    49  }
    50  ```
    51  
    52  ## Argument Reference
    53  
    54  The following arguments are supported:
    55  
    56  * `name` - (Required) This is the name of the hosted zone.
    57  * `comment` - (Optional) A comment for the hosted zone. Defaults to 'Managed by Terraform'.
    58  * `tags` - (Optional) A mapping of tags to assign to the zone.
    59  * `vpc_id` - (Optional) The VPC to associate with a private hosted zone. Specifying `vpc_id` will create a private hosted zone.
    60    Conflicts w/ `delegation_set_id` as delegation sets can only be used for public zones.
    61  * `vpc_region` - (Optional) The VPC's region. Defaults to the region of the AWS provider.
    62  * `delegation_set_id` - (Optional) The ID of the reusable delegation set whose NS records you want to assign to the hosted zone.
    63    Conflicts w/ `vpc_id` as delegation sets can only be used for public zones.
    64  * `force_destroy` - (Optional) Whether to destroy all records (possibly managed outside of Terraform)
    65    in the zone when destroying the zone.
    66  
    67  ## Attributes Reference
    68  
    69  The following attributes are exported:
    70  
    71  * `zone_id` - The Hosted Zone ID. This can be referenced by zone records.
    72  * `name_servers` - A list of name servers in associated (or default) delegation set.
    73    Find more about delegation sets in [AWS docs](https://docs.aws.amazon.com/Route53/latest/APIReference/actions-on-reusable-delegation-sets.html).
    74  
    75  
    76  ## Import
    77  
    78  Route53 Zones can be imported using the `zone id`, e.g. 
    79  
    80  ```
    81  $ terraform import aws_route53_zone.myzone Z1D633PJN98FT9
    82  ```