2014-07-23 21:47:21 +02:00
|
|
|
---
|
|
|
|
layout: "aws"
|
2014-07-23 21:56:28 +02:00
|
|
|
page_title: "AWS: aws_route53_zone"
|
2014-07-23 21:47:21 +02:00
|
|
|
sidebar_current: "docs-aws-resource-route53-zone"
|
2014-10-22 05:21:56 +02:00
|
|
|
description: |-
|
|
|
|
Provides a Route53 Hosted Zone resource.
|
2014-07-23 21:47:21 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# aws\_route53\_zone
|
|
|
|
|
|
|
|
Provides a Route53 Hosted Zone resource.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "aws_route53_zone" "primary" {
|
|
|
|
name = "example.com"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2015-02-26 23:20:30 +01:00
|
|
|
For use in subdomains, note that you need to create a
|
|
|
|
`aws_route53_record` of type `NS` as well as the subdomain
|
|
|
|
zone.
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "aws_route53_zone" "main" {
|
|
|
|
name = "example.com"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_route53_zone" "dev" {
|
|
|
|
name = "dev.example.com"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_route53_record" "dev-ns" {
|
|
|
|
zone_id = "${aws_route53_zone.main.zone_id}"
|
|
|
|
name = "dev.example.com"
|
|
|
|
type = "NS"
|
|
|
|
ttl = "30"
|
2015-04-14 21:18:38 +02:00
|
|
|
records = [
|
|
|
|
"${aws_route53_zone.dev.delegation_set_name_servers.0}",
|
|
|
|
"${aws_route53_zone.dev.delegation_set_name_servers.1}",
|
|
|
|
"${aws_route53_zone.dev.delegation_set_name_servers.2}",
|
|
|
|
"${aws_route53_zone.dev.delegation_set_name_servers.3}"
|
|
|
|
]
|
2015-02-26 23:20:30 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2014-07-23 21:47:21 +02:00
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `name` - (Required) This is the name of the hosted zone.
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `zone_id` - The Hosted Zone ID. This can be referenced by zone records.
|
|
|
|
|