We have a custom module that wraps the Cloudflare module, and I’m attempting to add a domain name to it by using for_each. There’s already one domain name deployed and in our terraform state. Right now I’m just trying to convert our manifest to use for_each, but still with one domain name. I’m hoping to see terraform plan
say nothing needs to be done. However, it says everything must be deleted and re-created. I did run terraform plan
before I made these changes, and it did say no changes were necessary.
Previously it looked like:
module "cloudflare" {
frontend_domain = var.cloudflare_frontend_domain
It now looks like:
module "cloudflare" {
for_each = var.cloudflare_frontend_domains
frontend_domain = each.value
Terraform v1.2.7. Cloudflare 3.13.0.
Thanks