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 : for record in data.dynu_dns_records.root.records :
format( format(
"%s_%s", "%s_%s",
can(regex("^[a-z]", 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(lower(format("%s_%s", record.hostname, record.record_type)), "[^a-z0-9]+", "_"), "_") ? trim(regexreplace(replace(lower(format("%s_%s", record.hostname, record.record_type)), "*", "wildcard"), "[^a-z0-9]+", "_"), "_")
: format("record_%s", trim(regexreplace(lower(format("%s_%s", record.hostname, record.record_type)), "[^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.id
) => record ) => record
} }