Open Jeffote opened 4 months ago
I ran into this when trying to add or remove lots of cnames from a list, though I get it with A records too. I converted my list to a set which solved the deletion issue. Now, Terraform is smart enough to only add or remove the domains that have changed. It may not fix the underlying cause but it's a workaround.
# Old
resource "pihole_cname_record" "this" {
count = length(local.all_cnames)
domain = local.all_cnames[count.index]
target = "ingress.example.local"
}
# New
resource "pihole_cname_record" "this" {
for_each = toset(local.all_cnames)
domain = each.key
target = "ingress.example.local"
}
The deletion of "pihole_dns_record" is not always working and leaves the entry in pihole untouched.
pihole version: v5.17.3 provider version: 0.2.0