mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-18 07:01:32 -04:00
- as per the API reference it is not possible to use delegation sets w/ private hosted zones - http://docs.aws.amazon.com/Route53/latest/APIReference/API-create-hosted-zone-private.html - http://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateHostedZone.html - if you specify both AWS returns confusing error "InvalidInput" with no further details so this should reduce potential confusions & improve UX
2.1 KiB
2.1 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| aws | AWS: aws_route53_zone | docs-aws-resource-route53-zone | Provides a Route53 Hosted Zone resource. |
aws_route53_zone
Provides a Route53 Hosted Zone resource.
Example Usage
resource "aws_route53_zone" "primary" {
name = "example.com"
}
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"
tags {
Environment = "dev"
}
}
resource "aws_route53_record" "dev-ns" {
zone_id = "${aws_route53_zone.main.zone_id}"
name = "dev.example.com"
type = "NS"
ttl = "30"
records = [
"${aws_route53_zone.dev.name_servers.0}",
"${aws_route53_zone.dev.name_servers.1}",
"${aws_route53_zone.dev.name_servers.2}",
"${aws_route53_zone.dev.name_servers.3}"
]
}
Argument Reference
The following arguments are supported:
name- (Required) This is the name of the hosted zone.comment- (Optional) A comment for the hosted zone. Defaults to 'Managed by Terraform'.tags- (Optional) A mapping of tags to assign to the zone.vpc_id- (Optional) The VPC to associate with a private hosted zone. Specifyingvpc_idwill create a private hosted zone. Conflicts w/delegation_set_idas delegation sets can only be used for public zones.vpc_region- (Optional) The VPC's region. Defaults to the region of the AWS provider.delegation_set_id- (Optional) The ID of the reusable delgation set whose NS records you want to assign to the hosted zone. Conflicts w/vpc_idas delegation sets can only be used for public zones.
Attributes Reference
The following attributes are exported:
zone_id- The Hosted Zone ID. This can be referenced by zone records.name_servers- A list of name servers in associated (or default) delegation set. Find more about delegation sets in AWS docs.