TerraformPilot

Infrastructure as Code

Terraform Cloudflare Provider v5.30.0: Breaking Changes, Rate Limiting, and Upgrade Notes

Cloudflare provider v5.30.0 breaking changes, new pacing/retry controls, and upgrade steps for Terraform users moving from v4.x or v5.29.x.

LLuca Berton4 min read

Introduction

#

Cloudflare has shipped terraform-provider-cloudflare v5.30.0, released 2026-12-04. The notes supplied here jump from v4.52.11 (previous known version) directly to v5.30.0, which spans a major version boundary — the v4 to v5 rewrite is a separate, much larger migration covered in Cloudflare's own migration guide and is out of scope for this article. This article covers what changed specifically in v5.30.0, based on the changelog entry for that release.

Note: the release notes provided are truncated mid-entry (cut off at notification_policy_webhook). The summary below reflects only what is confirmed in the notes; check the full release page for anything past that point before upgrading production configurations.

What Is New

#

Breaking changes

#

turnstile_widget: the direction, filter, order, page and per_page arguments are removed from the resource (they were list-query leftovers that never applied to create/update and caused spurious in-place updates). Remove them:

# Before (v5.29.0) — fails with "Unsupported argument" on v5.30.0
resource "cloudflare_turnstile_widget" "example" {
  account_id = var.account_id
  name       = "login-widget"
  domains    = ["example.com"]
  mode       = "managed"
  order      = "asc"
  page       = 1
}
 
# After
resource "cloudflare_turnstile_widget" "example" {
  account_id = var.account_id
  name       = "login-widget"
  domains    = ["example.com"]
  mode       = "managed"
}

The cloudflare_turnstile_widgets list data source keeps its query parameters unchanged.

workers_script outbound params: bindings[].outbound.params is now a list of objects, not strings:

# Before
bindings = [{
  type = "service"
  outbound = {
    params = ["foo", "bar"]
  }
}]
 
# After
bindings = [{
  type = "service"
  outbound = {
    params = [{ name = "foo" }, { name = "bar" }]
  }
}]

State is upgraded automatically for existing resources.

zero_trust_access_ai_controls_mcp_portal: servers changed from a set to a list, on both the resource and the _mcp_portal/_mcp_portals data sources. Order in configuration is now significant — reorder servers and expect an in-place update, including possibly on the first plan after upgrading if your config order doesn't match the order returned by server_id.

zone_setting data source: value is now dynamic instead of string, so numeric/list/object settings (browser_cache_ttl, ciphers, security_header, etc.) return typed values instead of null. Expressions that cast these to strings need updating.

zone_hold data source: include_subdomains is now bool, not string. Replace comparisons like == "true" with == true.

queue_consumer data source: consumer_id is now required — every read failed in v5.29.0 without it:

data "cloudflare_queue_consumer" "example" {
  account_id  = var.account_id
  queue_id    = var.queue_id
  consumer_id = var.consumer_id
}

zero_trust_risk_behavior data source: account_id is now required.

stream_key import: import IDs must now be <account_id>/<key_id>; a bare <account_id> (previously accepted) now errors and lists available signing key IDs.

terraform import cloudflare_stream_key.example <account_id>/<key_id>

Provider-level rate limiting and retries

#

The API client now paces and retries requests by default: 4 req/s (burst of 1) per provider instance, up to 4 retries on connection errors and 408/409/429/5xx, with 1–30s jittered backoff (honoring Retry-After/Retry-After-Ms). This should reduce 429 failures on large plans/applies, at the cost of longer run times. Tune it per provider block or via environment variables:

provider "cloudflare" {
  rps         = 8
  retries     = 6
  min_backoff = 1
  max_backoff = 20
}
export CLOUDFLARE_V5_RPS=8
export CLOUDFLARE_V5_RETRIES=6
export CLOUDFLARE_V5_MIN_BACKOFF=1
export CLOUDFLARE_V5_MAX_BACKOFF=20

Set rps = 0 to disable pacing, retries = 0 to disable retries.

Other notable changes

#
  • zero_trust_gateway_policy: rule_settings, schedule and expiration are now optional, non-computed. Omitting one now removes it on the next apply (plan shows -> null) instead of being silently preserved. Run terraform state show before upgrading to capture current values and add them explicitly if you want to keep them. rule_settings.biso_admin_controls.version no longer defaults to "v1".
  • workers_script placement: placement.target (with region, hostname, host) is now configurable but requires mode = "targeted"; the old top-level placement.region/hostname/host are now rejected at plan time (they were read-only, so no working config used them).
  • flagship_flag: variations is now dynamic instead of map(string) — booleans, numbers, and JSON objects/arrays are supported natively. Existing map(string) configs still work unchanged; module variables typed map(string) may need any if you adopt native types.
  • google_tag_gateway.hide_original_ip: deprecated, has no effect, now optional.
  • ai_search_instance: summarization, summarization_model, system_prompt_index_summarization deprecated — use indexing_options.file_summary instead.
  • zero_trust_device_custom_profile / zero_trust_device_default_profile: new always_exclude, always_include, speed_test_settings attributes are deprecated on arrival and ignored by the API — do not set them.
  • secrets_store_secret.scopes: now validated at plan time against access, agents, ai_gateway, containers, dex, websearch, workers.
  • cloudflare-go: bumped to v7.16.0, pulling in security fixes for golang.org/x/net, golang.org/x/text, and google.golang.org/grpc.

Upgrade Steps

#

Pin to the new version explicitly and run an upgrade:

terraform {
  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "~> 5.30.0"
    }
  }
}
terraform init -upgrade
terraform plan

Before running plan, audit configuration for:

  • Removed turnstile_widget arguments (direction, filter, order, page, per_page)
  • workers_script outbound.params string lists
  • zero_trust_gateway_policy blocks missing rule_settings/schedule/expiration that you intend to keep
  • stream_key imports in scripts or modules using bare account IDs
  • String comparisons against zone_hold.include_subdomains or non-string zone_setting values

If migrating from v4.x directly, treat this as two separate upgrades: first follow Cloudflare's v4→v5 migration guide, then apply the v5.30.0 notes above on top of a working v5.x baseline.

Verify

#
terraform providers
terraform plan -out=tfplan
terraform show -json tfplan | jq '.resource_changes[] | select(.change.actions != ["no-op"])'

Confirm the plan contains only expected diffs — particularly for zero_trust_gateway_policy (fields reverting to null), zero_trust_access_ai_controls_mcp_portal (servers reordering), and any resources with automatic state upgrades (workers_script, flagship_flag). An empty or fully-expected diff confirms a clean upgrade.

Conclusion

#

v5.30.0 removes several long-standing rough edges (unused turnstile arguments, string-typed numeric settings, data sources requiring previously optional IDs) and adds built-in API pacing that should cut down on 429 failures in large Cloudflare estates. The zero_trust_gateway_policy computed-to-optional change is the one most likely to cause surprise drift on apply — review existing policies before upgrading. Given the version gap from v4.52.11, also confirm the full v4→v5 migration has already been completed separately.

#Terraform#Cloudflare#Terraform Provider#Cloudflare Workers#Zero Trust#HCL

Share this article