Skip to content

Commit

Permalink
fix zone, for things like A.B.domain where domain is what is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 6, 2023
1 parent 54a6d7e commit aa4f14d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ locals {
locals {
name_parts = split(".", var.name)
host_name = local.name_parts[0]
zone = trimprefix(var.name, format("%v.", local.host_name))
zone = var.zone == null || var.zone == "" ? trimprefix(var.name, format("%v.", local.host_name)) : var.zone
private_zone = local.account_environment == "gov" ? true : var.private_zone
rr_type = upper(local.record_type)
default_enable_ptr = lookup(local._defaults.enable_ptr, local.record_type, false)
Expand Down
10 changes: 5 additions & 5 deletions common/variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# variable "zone" {
# description = "DNS Zone into which to create the record. By default, it will extract this from the name"
# type = string
# default = null
# }
variable "zone" {
description = "DNS Zone into which to create the record. By default, it will extract this from the name after the first dot."
type = string
default = null
}

variable "name" {
description = "FQDN DNS name to create. If the zone (everything after the first dot) does not exist or is not associated to the VPC, this creation will fail."
Expand Down

0 comments on commit aa4f14d

Please sign in to comment.