Skip to content

Commit

Permalink
Locals to separate locals.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbuckley committed Apr 20, 2023
1 parent 30930e3 commit f961374
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
4 changes: 0 additions & 4 deletions modules/aws/route53/dns.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
locals {
security_contact = var.security_contact != null ? var.security_contact : format("security@%s", var.domain)
}

resource "aws_route53_zone" "dns_zone" {
name = var.domain
comment = var.comment
Expand Down
16 changes: 16 additions & 0 deletions modules/aws/route53/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
locals {
security_contact = var.security_contact != null ? var.security_contact : format("security@%s", var.domain)

alias_records_list = flatten([
for zone, records in var.alias_records : [
for key, record in records : {
zone = zone
key = key
name = record.name != null ? record.name : zone
ttl = record.ttl != null ? record.ttl : var.default_ttl
type = record.type
records = record.records
}
]
])
}
15 changes: 0 additions & 15 deletions modules/aws/route53/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,3 @@ variable "caa_issuers" {
"amazon.com",
]
}

locals {
alias_records_list = flatten([
for zone, records in var.alias_records : [
for key, record in records : {
zone = zone
key = key
name = record.name != null ? record.name : zone
ttl = record.ttl != null ? record.ttl : var.default_ttl
type = record.type
records = record.records
}
]
])
}

0 comments on commit f961374

Please sign in to comment.