fabrica/terraform/modules/cadolesDNS/main.tf

30 lines
547 B
HCL

// Dependencies management
resource "null_resource" "depends_on" {
triggers = {
depends_on = join("", var.depends)
}
}
resource "dns_a_record_set" "a_records" {
for_each = var.dns_a_records
zone = var.dns_domain
name = each.key
ttl = 300
addresses = each.value
depends_on = [ null_resource.depends_on ]
}
resource "dns_cname_record" "cname_records" {
for_each = var.dns_cname_records
zone = var.dns_domain
name = each.key
cname = each.value
ttl = 300
depends_on = [ null_resource.depends_on ]
}