Skip to content

Commit

Permalink
Merge pull request #3279 from psutherland-cloudflare/psutherland/WAFF…
Browse files Browse the repository at this point in the history
…LE-640

WAFFLE-640: Mark cloudflare_rate_limit as deprecated
  • Loading branch information
jacobbednarz authored May 1, 2024
2 parents 79c3937 + 949bf32 commit c94e5e8
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .changelog/3279.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:note
resource/cloudflare_rate_limit: This resource is being deprecated in favor of the cloudflare_rulesets resource
```
4 changes: 2 additions & 2 deletions docs/resources/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Filter expressions that can be referenced across multiple features,
e.g. Firewall Rules. See [what is a filter](https://developers.cloudflare.com/firewall/api/cf-filters/what-is-a-filter/)
for more details and available fields and operators.

~> `cloudflare_filter` is in a deprecation phase that will last for one
year (May 1st, 2024). During this time period, this resource is still fully
~> `cloudflare_filter` is in a deprecation phase that will last for 14 months
(July 1st, 2024). During this time period, this resource is still fully
supported but you are strongly advised to move to the
`cloudflare_ruleset` resource. Full details can be found in the
[developer documentation](https://developers.cloudflare.com/waf/reference/migration-guides/firewall-rules-to-custom-rules/#relevant-changes-for-terraform-users).
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/firewall_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ rule creation.
Filter expressions needs to be created first before using Firewall
Rule.

~> `cloudflare_firewall_rule` is in a deprecation phase that will last for one
year (May 1st, 2024). During this time period, this resource is still fully
supported but you are strongly advised to move to the `cloudflare_ruleset`
resource. Full details can be found in the
~> `cloudflare_firewall_rule` is in a deprecation phase that will last for 14
months (July 1st, 2024). During this time period, this resource is still
fully supported but you are strongly advised to move to the
`cloudflare_ruleset` resource. Full details can be found in the
[developer documentation](https://developers.cloudflare.com/waf/reference/migration-guides/firewall-rules-to-custom-rules/#relevant-changes-for-terraform-users).

## Example Usage
Expand Down
7 changes: 7 additions & 0 deletions docs/resources/rate_limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ Provides a Cloudflare rate limit resource for a given zone. This can
be used to limit the traffic you receive zone-wide, or matching more
specific types of requests/responses.

~> `cloudflare_rate_limit` is in a deprecation phase that will last for 14
months (July 1st, 2024). During this time period, this resource is still
fully supported but you are strongly advised to move to the
`cloudflare_ruleset` resource. Full details can be found in the
[developer documentation](https://developers.cloudflare.com/waf/reference/migration-guides/old-rate-limiting-deprecation/#relevant-changes-for-terraform-users).


## Example Usage

```terraform
Expand Down
4 changes: 4 additions & 0 deletions docs/resources/teams_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ Optional:

- `id` (String) ID of custom certificate.

Read-Only:

- `updated_at` (String)


<a id="nestedblock--extended_email_matching"></a>
### Nested Schema for `extended_email_matching`
Expand Down
2 changes: 1 addition & 1 deletion internal/sdkv2provider/resource_cloudflare_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func resourceCloudflareFilter() *schema.Resource {
`),
DeprecationMessage: heredoc.Doc(fmt.Sprintf(`
%s resource is in a deprecation phase that will
last for one year (May 1st, 2024). During this time period, this
last for 14 months (July 1st, 2024). During this time period, this
resource is still fully supported but you are strongly advised
to move to the %s resource. For more information, see
https://developers.cloudflare.com/waf/reference/migration-guides/firewall-rules-to-custom-rules/#relevant-changes-for-terraform-users.
Expand Down
4 changes: 2 additions & 2 deletions internal/sdkv2provider/resource_cloudflare_firewall_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"errors"
"fmt"
"github.com/MakeNowJust/heredoc/v2"
"strings"

"github.com/MakeNowJust/heredoc/v2"
cloudflare "github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/terraform-provider-cloudflare/internal/consts"
"github.com/hashicorp/terraform-plugin-log/tflog"
Expand Down Expand Up @@ -35,7 +35,7 @@ func resourceCloudflareFirewallRule() *schema.Resource {
`),
DeprecationMessage: heredoc.Doc(fmt.Sprintf(`
%s resource is in a deprecation phase that will
last for one year (May 1st, 2024). During this time period, this
last for 14 months (July 1st, 2024). During this time period, this
resource is still fully supported but you are strongly advised
to move to the %s resource. For more information, see
https://developers.cloudflare.com/waf/reference/migration-guides/firewall-rules-to-custom-rules/#relevant-changes-for-terraform-users.
Expand Down
7 changes: 7 additions & 0 deletions internal/sdkv2provider/resource_cloudflare_rate_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ func resourceCloudflareRateLimit() *schema.Resource {
be used to limit the traffic you receive zone-wide, or matching more
specific types of requests/responses.
`),
DeprecationMessage: heredoc.Doc(fmt.Sprintf(`
%s resource is in a deprecation phase that will
last for 14 months (July 1st, 2024). During this time period, this
resource is still fully supported but you are strongly advised
to move to the %s resource. For more information, see
https://developers.cloudflare.com/waf/reference/migration-guides/old-rate-limiting-deprecation/#relevant-changes-for-terraform-users.
`, "`cloudflare_rate_limit`", "`cloudflare_ruleset`")),
}
}

Expand Down
4 changes: 2 additions & 2 deletions templates/resources/filter.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ description: |-

{{ .Description | trimspace }}

~> `cloudflare_filter` is in a deprecation phase that will last for one
year (May 1st, 2024). During this time period, this resource is still fully
~> `cloudflare_filter` is in a deprecation phase that will last for 14 months
(July 1st, 2024). During this time period, this resource is still fully
supported but you are strongly advised to move to the
`cloudflare_ruleset` resource. Full details can be found in the
[developer documentation](https://developers.cloudflare.com/waf/reference/migration-guides/firewall-rules-to-custom-rules/#relevant-changes-for-terraform-users).
Expand Down
8 changes: 4 additions & 4 deletions templates/resources/firewall_rule.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ description: |-

{{ .Description | trimspace }}

~> `cloudflare_firewall_rule` is in a deprecation phase that will last for one
year (May 1st, 2024). During this time period, this resource is still fully
supported but you are strongly advised to move to the `cloudflare_ruleset`
resource. Full details can be found in the
~> `cloudflare_firewall_rule` is in a deprecation phase that will last for 14
months (July 1st, 2024). During this time period, this resource is still
fully supported but you are strongly advised to move to the
`cloudflare_ruleset` resource. Full details can be found in the
[developer documentation](https://developers.cloudflare.com/waf/reference/migration-guides/firewall-rules-to-custom-rules/#relevant-changes-for-terraform-users).

{{ if .HasExample -}}
Expand Down
32 changes: 32 additions & 0 deletions templates/resources/rate_limit.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | trimspace }}

~> `cloudflare_rate_limit` is in a deprecation phase that will last for 14
months (July 1st, 2024). During this time period, this resource is still
fully supported but you are strongly advised to move to the
`cloudflare_ruleset` resource. Full details can be found in the
[developer documentation](https://developers.cloudflare.com/waf/reference/migration-guides/old-rate-limiting-deprecation/#relevant-changes-for-terraform-users).


{{ if .HasExample -}}
## Example Usage

{{codefile "terraform" .ExampleFile}}
{{- end }}
{{ .SchemaMarkdown | trimspace }}

{{ if .HasImport -}}
## Import

Import is supported using the following syntax:

{{codefile "shell" .ImportFile}}
{{- end }}

0 comments on commit c94e5e8

Please sign in to comment.