Align wildcard DNS name sanitization across outputs and generator

This commit is contained in:
beatz174-bit
2026-05-13 06:23:03 +10:00
parent 52bd2d9fa2
commit 63b47b59b5
+3 -3
View File
@@ -7,9 +7,9 @@ locals {
for record in data.dynu_dns_records.root.records :
format(
"%s_%s",
can(regex("^[a-z]", regexreplace(lower(format("%s_%s", record.hostname, record.record_type)), "[^a-z0-9]+", "_")))
? trim(regexreplace(lower(format("%s_%s", record.hostname, record.record_type)), "[^a-z0-9]+", "_"), "_")
: format("record_%s", trim(regexreplace(lower(format("%s_%s", record.hostname, record.record_type)), "[^a-z0-9]+", "_"), "_")),
can(regex("^[a-z]", regexreplace(replace(lower(format("%s_%s", record.hostname, record.record_type)), "*", "wildcard"), "[^a-z0-9]+", "_")))
? trim(regexreplace(replace(lower(format("%s_%s", record.hostname, record.record_type)), "*", "wildcard"), "[^a-z0-9]+", "_"), "_")
: format("record_%s", trim(regexreplace(replace(lower(format("%s_%s", record.hostname, record.record_type)), "*", "wildcard"), "[^a-z0-9]+", "_"), "_")),
record.id
) => record
}