Open nialdaly opened 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
this is unfortunately a known issue with swapping between zero values in Terraform SDKv2. we can mitigate it by migrating to the plugin framework however i do not have an ETA on when that will happen. in the meantime, to swap the value you will need to remove it from your state file, and reapply it with the false value set.
Hi @jacobbednarz! Thanks for the prompt response, makes sense. Cheers!
in the meantime, to swap the value you will need to remove it from your state file, and reapply it with the false value set.
that appears to change flag in the web, but tf plan always says it needs to make modifications:
resource "cloudflare_managed_headers" "managed_headers" {
zone_id = cloudflare_zone.zone.id
managed_request_headers {
enabled = false
id = "add_client_certificate_headers"
}
managed_request_headers {
enabled = false
id = "add_visitor_location_headers"
}
managed_request_headers {
enabled = false
id = "remove_visitor_ip_headers"
}
managed_response_headers {
enabled = false
id = "add_security_headers"
}
}
cloudflare_managed_headers.managed_headers will be updated in-place
~ resource "cloudflare_managed_headers" "managed_headers" {
id = "94b23da3bb6dabefcb39c7f845a7d681"
# (1 unchanged attribute hidden)
+ managed_request_headers {
+ enabled = false
+ id = "add_client_certificate_headers"
}
+ managed_request_headers {
+ enabled = false
+ id = "add_visitor_location_headers"
}
+ managed_request_headers {
+ enabled = false
+ id = "remove_visitor_ip_headers"
}
- managed_response_headers {
- enabled = true -> null
- id = "remove_x-powered-by_header" -> null
}
+ managed_response_headers {
+ enabled = false
+ id = "add_security_headers"
}
}
Confirmation
Terraform and Cloudflare provider version
Terraform v1.5.7 on darwin_arm64
Affected resource(s)
Terraform configuration files
Link to debug output
https://gist.github.com/nialdaly/a3f6924e3812791a0e6bdf4d23157ca1
Panic output
No response
Expected output
Actual output
Steps to reproduce
Create a
cloudflare_managed_headers
resource with the following configuration:terraform apply
.Update the
cloudflare_managed_headers
resource to the following configuration:terraform apply
.enabled
when it should be nowdisabled
.Additional factoids
No response
References
No response