diff --git a/README.md b/README.md index f217031..99d8a81 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ Available targets: | ipv6_enabled | Set to true to enable an AAAA DNS record to be set as well as the A record | bool | `false` | no | | parent_zone_id | ID of the hosted zone to contain this record (or specify `parent_zone_name`) | string | `` | no | | parent_zone_name | Name of the hosted zone to contain this record (or specify `parent_zone_id`) | string | `` | no | +| private_zone | Is this a private hosted zone? | bool | `false` | no | | target_dns_name | DNS name of target resource (e.g. ALB, ELB) | string | - | yes | | target_zone_id | ID of target resource (e.g. ALB, ELB) | string | - | yes | diff --git a/docs/terraform.md b/docs/terraform.md index 37ae501..6544d9a 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -8,6 +8,7 @@ | ipv6_enabled | Set to true to enable an AAAA DNS record to be set as well as the A record | bool | `false` | no | | parent_zone_id | ID of the hosted zone to contain this record (or specify `parent_zone_name`) | string | `` | no | | parent_zone_name | Name of the hosted zone to contain this record (or specify `parent_zone_id`) | string | `` | no | +| private_zone | Is this a private hosted zone? | bool | `false` | no | | target_dns_name | DNS name of target resource (e.g. ALB, ELB) | string | - | yes | | target_zone_id | ID of target resource (e.g. ALB, ELB) | string | - | yes | diff --git a/main.tf b/main.tf index ca981e8..1622c23 100644 --- a/main.tf +++ b/main.tf @@ -1,7 +1,8 @@ data "aws_route53_zone" "default" { - count = var.enabled ? signum(length(compact(var.aliases))) : 0 - zone_id = var.parent_zone_id - name = var.parent_zone_name + count = var.enabled ? signum(length(compact(var.aliases))) : 0 + zone_id = var.parent_zone_id + name = var.parent_zone_name + private_zone = var.private_zone } resource "aws_route53_record" "default" { @@ -28,4 +29,4 @@ resource "aws_route53_record" "ipv6" { zone_id = var.target_zone_id evaluate_target_health = var.evaluate_target_health } -} \ No newline at end of file +} diff --git a/variables.tf b/variables.tf index 174a4fe..99f7215 100644 --- a/variables.tf +++ b/variables.tf @@ -15,6 +15,12 @@ variable "parent_zone_name" { description = "Name of the hosted zone to contain this record (or specify `parent_zone_id`)" } +variable "private_zone" { + type = bool + default = false + description = "Is this a private hosted zone?" +} + variable "target_dns_name" { type = string description = "DNS name of target resource (e.g. ALB, ELB)"