You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing a page_rule from this:resource"cloudflare_page_rule""subdomain_settings" {
zone="${var.domain}"target="https://subdomain.website.com/*"actions={
ssl ="flexible"
cache_level ="aggressive"
}
priority=43status="active"
}
to this:resource"cloudflare_page_rule""subdomain_settings" {
zone="${var.domain}"target="https://subdomain.website.com/*"actions={
forwarding_url {
url ="https://offline.website.com/maintenance.html"
status_code =302
}
}
priority=43status="active"
}
Debug Output
* cloudflare_page_rule.subdomain_settings: 1 error(s) occurred:
* cloudflare_page_rule.subdomain_settings: Failed to update Cloudflare Page Rule: error from makeRequest: HTTP status 400: content "{\"success\":false,\"errors\":[{\"code\":1004,\"message\":\"Page Rule validation failed: See messages for details.\"}],\"messages\":[{\"code\":1,\"message\":\".settings: \\\"forwarding_url\\\" may not be used with \\\"any setting\\\"\",\"type\":null}],\"result\":null}"
Expected Behavior
The ssl and cache_level settings should be removed from the pagerule and the forwarding_url setting added to the page_rule
Actual Behavior
The change is aborted due to a validation error
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
terraform apply
The text was updated successfully, but these errors were encountered:
The same validation issue also happens when you try to reverse the change. We needed to update the rule manually in the CloudFlare web UI (which applies the exact same change without any problem)
Thanks for the report! The crux of the issue here is that we're using the PATCH endpoint to update in place instead of the PUT endpoint which replaces the rule entirely (what you see working in the UI). The reasoning for this (and some options) are called out in #198.
Terraform Version
v0.11.11
Affected Resource(s)
cloudflare_page_rule
Terraform Configuration Files
Debug Output
Expected Behavior
The ssl and cache_level settings should be removed from the pagerule and the forwarding_url setting added to the page_rule
Actual Behavior
The change is aborted due to a validation error
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
terraform apply
The text was updated successfully, but these errors were encountered: