From 949bf32a83f7fbb2476045367328307499a33bda Mon Sep 17 00:00:00 2001 From: Peter Sutherland Date: Tue, 30 Apr 2024 13:28:43 +0100 Subject: [PATCH] WAFFLE-640: Mark cloudflare_rate_limit as deprecated and update deprecation dates --- .changelog/3279.txt | 3 ++ docs/resources/filter.md | 4 +-- docs/resources/firewall_rule.md | 8 ++--- docs/resources/rate_limit.md | 7 ++++ docs/resources/teams_account.md | 4 +++ .../resource_cloudflare_filter.go | 2 +- .../resource_cloudflare_firewall_rule.go | 4 +-- .../resource_cloudflare_rate_limit.go | 7 ++++ templates/resources/filter.md.tmpl | 4 +-- templates/resources/firewall_rule.md.tmpl | 8 ++--- templates/resources/rate_limit.md.tmpl | 32 +++++++++++++++++++ 11 files changed, 68 insertions(+), 15 deletions(-) create mode 100644 .changelog/3279.txt create mode 100644 templates/resources/rate_limit.md.tmpl diff --git a/.changelog/3279.txt b/.changelog/3279.txt new file mode 100644 index 0000000000..ce9e8f5cc1 --- /dev/null +++ b/.changelog/3279.txt @@ -0,0 +1,3 @@ +```release-note:note +resource/cloudflare_rate_limit: This resource is being deprecated in favor of the cloudflare_rulesets resource +``` \ No newline at end of file diff --git a/docs/resources/filter.md b/docs/resources/filter.md index 62378e4e69..8dbe976149 100644 --- a/docs/resources/filter.md +++ b/docs/resources/filter.md @@ -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). diff --git a/docs/resources/firewall_rule.md b/docs/resources/firewall_rule.md index 76590033da..e1d03333be 100644 --- a/docs/resources/firewall_rule.md +++ b/docs/resources/firewall_rule.md @@ -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 diff --git a/docs/resources/rate_limit.md b/docs/resources/rate_limit.md index 4b6ae31bf2..141e114cf4 100644 --- a/docs/resources/rate_limit.md +++ b/docs/resources/rate_limit.md @@ -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 diff --git a/docs/resources/teams_account.md b/docs/resources/teams_account.md index 5699ec2f8b..7754711762 100644 --- a/docs/resources/teams_account.md +++ b/docs/resources/teams_account.md @@ -163,6 +163,10 @@ Optional: - `id` (String) ID of custom certificate. +Read-Only: + +- `updated_at` (String) + ### Nested Schema for `extended_email_matching` diff --git a/internal/sdkv2provider/resource_cloudflare_filter.go b/internal/sdkv2provider/resource_cloudflare_filter.go index 09455aee63..688f434534 100644 --- a/internal/sdkv2provider/resource_cloudflare_filter.go +++ b/internal/sdkv2provider/resource_cloudflare_filter.go @@ -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. diff --git a/internal/sdkv2provider/resource_cloudflare_firewall_rule.go b/internal/sdkv2provider/resource_cloudflare_firewall_rule.go index 5d7c310f77..38c08e5a0e 100644 --- a/internal/sdkv2provider/resource_cloudflare_firewall_rule.go +++ b/internal/sdkv2provider/resource_cloudflare_firewall_rule.go @@ -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" @@ -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. diff --git a/internal/sdkv2provider/resource_cloudflare_rate_limit.go b/internal/sdkv2provider/resource_cloudflare_rate_limit.go index 4d2eb90db2..3775d7e24c 100644 --- a/internal/sdkv2provider/resource_cloudflare_rate_limit.go +++ b/internal/sdkv2provider/resource_cloudflare_rate_limit.go @@ -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`")), } } diff --git a/templates/resources/filter.md.tmpl b/templates/resources/filter.md.tmpl index 85eb9d02f8..27b5ee7154 100644 --- a/templates/resources/filter.md.tmpl +++ b/templates/resources/filter.md.tmpl @@ -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). diff --git a/templates/resources/firewall_rule.md.tmpl b/templates/resources/firewall_rule.md.tmpl index abaa362101..2602a5793a 100644 --- a/templates/resources/firewall_rule.md.tmpl +++ b/templates/resources/firewall_rule.md.tmpl @@ -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 -}} diff --git a/templates/resources/rate_limit.md.tmpl b/templates/resources/rate_limit.md.tmpl new file mode 100644 index 0000000000..d59f14fad7 --- /dev/null +++ b/templates/resources/rate_limit.md.tmpl @@ -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 }}