-
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
resource/ruleset: add support for HTTP rate limiting #1179
Conversation
@@ -107,6 +133,7 @@ The following arguments are supported: | |||
* `enabled` - (Optional) Whether the rule is active. | |||
* `expression` - (Required) Criteria for an HTTP request to trigger the ruleset rule action. Uses the Firewall Rules expression language based on Wireshark display filters. Refer to the [Firewall Rules language](https://developers.cloudflare.com/firewall/cf-firewall-language) documentation for all available fields, operators, and functions. | |||
* `id` - (Read only) Unique rule identifier. | |||
* `ratelimit` - (Optional) List of parameters that configure HTTP rate limiting behaviour (refer to the [nested schema](#nestedblock--ratelimiting-parameters)). |
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.
cc @pedrosousa for 👀
CI is happy (with
|
website/docs/r/ruleset.html.markdown
Outdated
<a id="nestedblock--ratelimiting-parameters"></a> | ||
**Nested schema for `ratelimit`** | ||
|
||
* `characteristics` - (Optional) List of parameters that define how Cloudflare tracks the request rate for this rule. |
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.
Quick note about the optional/mandatory fields (sorry for only noticing this now).
For rate limiting rules, only "mitigation_expression" is optional. However, all the fields are marked as optional.
It would probably be more useful to say if the fields are mandatory/optional in the context of the current nested schema. However, all other sections consider the global rule definition context, so they would also have to be changed.
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.
The value will come from the Terraform schema which unfortunately doesn't have the same level of context as the API itself so in that aspect, and what we report here, the fields are optional. In the past, we've leant on adequate documentation in the API or developer documentation to provide more insight into available configurations.
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.
Revert capitalization changes back to "Rate Limiting rules".
4daf445
to
ba8f66c
Compare
ba8f66c
to
3d98132
Compare
Depends on cloudflare/cloudflare-go#700
Closes #1170