Refactor DNS-config to make it easier to maintain

This commit is contained in:
2025-03-04 23:15:42 +01:00
parent 3a09b0f44e
commit 817f75bb49
5 changed files with 62 additions and 53 deletions

View File

@@ -4,11 +4,11 @@ resource "hetznerdns_zone" "this" {
}
locals {
records = {
records = nonsensitive({
for record in var.records : "${record.type}#${record.name}#${md5(record.value)}" => {
for key, value in record : key => value
}
}
})
}
resource "hetznerdns_record" "this" {

View File

@@ -12,7 +12,7 @@ variable "records" {
name = string
value = string
type = string
ttl = optional(number, 3600)
ttl = optional(number, null)
}))
default = []
}