-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page rule additions #68
Conversation
…le-resolve_override add resolve_override page_rule action
…le-resolve_override add doc for resolve_override
…le-host_header_override add host_header_override page_rule action
…le-host_header_override missing bracket after merge conflict
…le-resolve_override fix typo and go fmt
…le-host_header_override go fmt
…le-bypass_cache_on_cookie Add page rule bypass cache on cookie
…le-disabled page_rules status is active or disabled not paused
…ule-waf add waf page rule
…ule-waf add doc for waf page rule keyword
Add `explicit_cache_control` (called "Origin Cache Control" in the UI).
We set `security_level` to `off` in some of our page rules, but this provider doesn't support that value. The underlying API does, however, so add it as a valid value.
@@ -59,7 +59,7 @@ Action blocks support the following: | |||
* `host_header_override` - (Optional) The Host Header to override on the origin servers. | |||
* `resolve_override` - (Optional) Override the origin server with this host. | |||
* `rocket_loader` - (Optional) Whether to set the rocket loader to `"off"`, `"manual"`, or `"automatic"`. | |||
* `security_level` - (Optional) Whether to set the security level to `"essentially_off"`, `"low"`, `"medium"`, `"high"`, or `"under_attack"`. | |||
* `security_level` - (Optional) Whether to set the security level to `"off"`, `"essentially_off"`, `"low"`, `"medium"`, `"high"`, or `"under_attack"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"off" is an enterprise only feature - do we need to make note of this somewhere? Or just rely on the API to return sane error messages if it isn't available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's the responsibility of the provider to know or care about a customer's contract type with Cloudflare. The API should just To The Right Thing ™️ if a user without appropriate permissions tries to use it.
This is an enterprise-only feature, but as mentioned in this PR's comments, I don't think that's a concern of this provider.
Closing in favor of https://github.com/terraform-providers/terraform-provider-cloudflare/pull/81, which is based on current |
This PR adds a new page rule action and adds a new value to an existing action.
It is based on unmerged upstream PR terraform-providers#61, so currently includes the changes from that PR as well.
explicit_cache_control action
off
value tosecurity_level
actionI've been using this code for the past couple of days and it's working as expected -- I can successfully enable the
explicit_cache_control
action and setsecurity_level
tooff
via Terraform, and see the results reflected in the Page Rules UI.Note: I haven't written any tests because the existing test suite doesn't test each action and value. Happy to add tests that exercise the new functionality if you'd prefer.
Thanks for your consideration!
Ross