Skip to content

Commit

Permalink
resource/cloudflare_ruleset: mark requests_to_origin required for r…
Browse files Browse the repository at this point in the history
…atelimit blocks

Closes #2722
  • Loading branch information
jacobbednarz committed Oct 1, 2023
1 parent ae3ef73 commit 68d480c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/2808.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/cloudflare_ruleset: mark `requests_to_origin` required for ratelimit blocks
```
5 changes: 4 additions & 1 deletion docs/resources/ruleset.md
Original file line number Diff line number Diff line change
Expand Up @@ -829,14 +829,17 @@ Optional:
<a id="nestedblock--rules--ratelimit"></a>
### Nested Schema for `rules.ratelimit`

Required:

- `requests_to_origin` (Boolean) Whether to include requests to origin within the Rate Limiting count.

Optional:

- `characteristics` (Set of String) List of parameters that define how Cloudflare tracks the request rate for this rule.
- `counting_expression` (String) Criteria for counting HTTP requests to trigger the Rate Limiting 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.
- `mitigation_timeout` (Number) Once the request rate is reached, the Rate Limiting rule blocks further requests for the period of time defined in this field.
- `period` (Number) The period of time to consider (in seconds) when evaluating the request rate.
- `requests_per_period` (Number) The number of requests over the period of time that will trigger the Rate Limiting rule.
- `requests_to_origin` (Boolean) Whether to include requests to origin within the Rate Limiting count.
- `score_per_period` (Number) The maximum aggregate score over the period of time that will trigger Rate Limiting rule.
- `score_response_header_name` (String) Name of HTTP header in the response, set by the origin server, with the score for the current request.

Expand Down
2 changes: 1 addition & 1 deletion internal/framework/service/rulesets/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ func (r *RulesetResource) Schema(ctx context.Context, req resource.SchemaRequest
MarkdownDescription: "Criteria for counting HTTP requests to trigger the Rate Limiting 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.",
},
"requests_to_origin": schema.BoolAttribute{
Optional: true,
Required: true,
MarkdownDescription: "Whether to include requests to origin within the Rate Limiting count.",
},
},
Expand Down

0 comments on commit 68d480c

Please sign in to comment.