github cloudflare/terraform-provider-cloudflare v5.30.0

2 hours ago

5.30.0 (2026-12-04)

Full Changelog: v5.29.0...v5.30.0

⚠ BREAKING CHANGES

  • turnstile_widget: the direction, filter, order, page and per_page arguments have been removed from the resource. They are list-query parameters that were never used when creating or updating a widget, and their defaults made every widget upgraded from older state plan an in-place update. Remove them from any configuration; a configuration that still sets them fails with an "Unsupported argument" error. Stored values are dropped automatically. The cloudflare_turnstile_widgets list data source keeps its query parameters.
  • workers_script: bindings[].outbound.params is now a list of objects instead of a list of strings, matching the Workers API. Change params = ["foo", "bar"] to params = [{ name = "foo" }, { name = "bar" }]. An automatic state upgrade converts stored string values to objects.
  • zero_trust_access_ai_controls_mcp_portal: servers is now a list instead of a set on the resource and on the cloudflare_zero_trust_access_ai_controls_mcp_portal and cloudflare_zero_trust_access_ai_controls_mcp_portals data sources. This removes the slow plans for portals with many servers. An automatic state upgrade converts existing state. Order in configuration is now significant: reordering servers plans an in-place update, and the first plan after upgrading may show one if your configuration order differs from the order by server_id.
  • zone_setting (data source): value is now dynamic instead of a string, so settings whose API value is a number, list or object (for example browser_cache_ttl, ciphers, security_header) return their value instead of null. String settings read as before. Update expressions that treated non-string settings as strings.
  • zone_hold (data source): include_subdomains is now a bool instead of a string, matching the API. It was always null before. Update any comparisons against "true" or "false" to use booleans.
  • queue_consumer (data source): consumer_id is now required, and the data source looks up that consumer. Every read of the data source failed in v5.29.0. Set consumer_id in the data source configuration.
  • zero_trust_risk_behavior (data source): account_id is now required. Set it in the data source configuration.
  • stream_key: import now requires <account_id>/<key_id>. A bare <account_id> import ID, accepted by v5.29.0, now fails with an error that lists the account's signing key IDs.

Notes

  • provider: the API client now paces and retries requests by default: 4 requests per second (burst of one) per provider instance, up to 4 retries for connection errors and 408, 409, 429 and 5xx responses, and a backoff of 1 to 30 seconds with jitter. A Retry-After or Retry-After-Ms header from the API sets the wait. Large plans and applies may take longer but should no longer fail with 429 errors. Use the new rps, retries, min_backoff and max_backoff provider arguments, or the CLOUDFLARE_V5_RPS, CLOUDFLARE_V5_RETRIES, CLOUDFLARE_V5_MIN_BACKOFF and CLOUDFLARE_V5_MAX_BACKOFF environment variables, to change them; rps = 0 turns pacing off and retries = 0 turns retries off.
  • cloudflare-go: the Go SDK dependency is updated to v7.16.0. golang.org/x/net, golang.org/x/text and google.golang.org/grpc are raised to versions with security fixes.
  • zero_trust_gateway_policy: rule_settings, schedule and expiration are now optional and no longer computed. The provider manages only what your configuration sets: leaving one of them out now removes it from the policy on the next apply, and the plan shows -> null. Previously the provider kept the old value in the plan while the API cleared it. To keep a policy's rule settings, schedule or expiration, put them in your configuration (terraform state show lists the current values). rule_settings.biso_admin_controls.version no longer defaults to "v1".
  • workers_script: placement.target and its region, hostname and host are now configurable, so targeted placement works. placement.target requires mode = "targeted", and mode = "targeted" requires at least one target. The top-level placement.region, placement.hostname and placement.host are rejected at plan time with a message pointing to mode = "targeted" and target; they were read-only before, so no working configuration used them.
  • flagship_flag: variations is now a dynamic attribute instead of map(string), so variation values can be booleans, numbers, strings, or JSON objects and arrays. Existing configurations that use a map of strings, such as variations = { on = "true", off = "false" }, need no change, and an automatic state upgrade converts state written by v5.29.0 and earlier. To serve typed values, write them natively (variations = { on = true, off = false }); module variables or outputs typed as map(string) that pass this attribute may then need any.
  • google_tag_gateway: hide_original_ip is now optional and deprecated. It is stored but has no effect on traffic; when omitted, the previously stored value is kept.
  • ai_search_instance: summarization, summarization_model and system_prompt_index_summarization are deprecated and ignored during indexing and search. Use indexing_options.file_summary instead. Changing summarization or summarization_model still re-indexes existing files on the next sync.
  • zero_trust_device_custom_profile, zero_trust_device_default_profile: the new always_exclude, always_include and speed_test_settings attributes are deprecated and ignored by the API; do not set them.
  • secrets_store_secret: scopes values are now validated at plan time against the accepted services (access, agents, ai_gateway, containers, dex, websearch, workers).
  • notification_policy_webhooks: changing url, or adding, changing or removing secret, now replaces the webhook, which gets a new ID. The API's update endpoint applies only name, so in v5.29.0 such a change was silently not applied. Notification policies that reference the webhook update in place. After an import, or an upgrade from state that holds the redacted URL, expect one in-place update that stores the configured url. Because the API never returns secret, an imported webhook whose configuration sets secret is replaced once.
  • zero_trust_access_application: import now stores auto_redirect_to_identity, enable_binding_cookie and options_preflight_bypass as null when the API returns false, so configurations that omit them import without a diff. A configuration that sets one of them to false explicitly sees one in-place update after import.
  • zero_trust_tunnel_cloudflared_config: destroying the resource, or removing it from configuration, now resets the tunnel's remote configuration through the API, removing its ingress rules and origin request settings. In v5.29.0 destroy only removed the resource from state. To stop managing a configuration without changing the live tunnel, run terraform state rm (or use a removed block with destroy = false) instead.
  • worker: the new observability.agents attribute requires the Workers observability agents feature on the account; without it the API rejects agents.enabled = true. The API currently does not return agents in responses, so setting agents in configuration plans an update on every run. Leave agents unset until this is resolved.

Features

New Resources

  • cloudflare_security_txt: manage a zone's security.txt file served at /.well-known/security.txt, including contacts, expiry, encryption keys, policies, acknowledgments, hiring links, canonical URIs and preferred languages. enabled is required. Supports terraform import using the zone ID.
  • cloudflare_security_insights_configuration: enable or disable scheduled Security Insights scans for an account. Supports terraform import using the account ID.
  • cloudflare_waf_payload_logging_key: manage the X25519 public key that WAF uses to encrypt matched payloads, for an account or a zone. Cloudflare stores only the public key.

New Data Sources

  • Singular data sources for each new resource above (cloudflare_security_txt, cloudflare_security_insights_configuration, cloudflare_waf_payload_logging_key).

New Attributes

  • provider: rps, retries, min_backoff and max_backoff to tune request pacing and retries.
  • ai_gateway: multiprovider_enabled to let requests to a model use every provider that serves it; computed internal_id.
  • ai_search_instance: indexing_options.file_summary, source_params.d1 for D1 sources, and source_params.web_crawler.parse_options.browser_rendering_wait_until.
  • d1_databases (data source): fields filter; file_size, num_tables and recommendation_count in results.
  • dns_records (data source): cursor and prev_cursor for cursor pagination (also on the cloudflare_dns_record data source filter).
  • hostname_tls_settings (data source): limit and offset.
  • logpush_job: computed destination_name (also on the cloudflare_logpush_dataset_job data source).
  • notification_policy: filters.alert_trigger_preferences_long_window, alert_trigger_preferences_minimum_threshold, alert_trigger_preferences_operator, alert_trigger_preferences_short_window, check_id, execution_interval, query_id, source and total_spend_dollars.
  • pipeline: computed outdated.
  • pipeline_sink: computed latest, used_by and version.
  • queue_consumer: computed id.
  • r2_bucket: force_destroy to delete every object in a bucket before destroying it. Objects are deleted permanently.
  • r2_data_catalog: computed catalog_uri.
  • ruleset (data source): include_rules.
  • spectrum_application: edge_alpn_protocols to set the ALPN protocols the edge offers on client TLS connections.
  • stream: computed customer_code, encoding_mode and preview_status.
  • stream_key (data source): key_id can be set to select a key; it is required when the account has several keys.
  • worker: observability.agents, observability.redact_query_string and previews_base_config.observability.agents; immutable_id on the data source.
  • workers_for_platforms_dispatch_namespace: trusted_workers is now configurable.
  • workers_script: bindings.outbound.worker.entrypoint, observability.agents and observability.redact_query_string.
  • zero_trust_access_application: destinations.overrides to make matching paths of public and Worker destinations bypass Access; session_duration on inline policies.
  • zero_trust_access_identity_provider: config.metadata_url for SAML providers that publish signing certificates in a metadata document.
  • zero_trust_device_custom_profile: enable_netbt.
  • zero_trust_device_default_profile: description and enable_netbt.
  • zero_trust_device_settings: computed id.
  • zero_trust_gateway_certificate: region can be set at creation to pin the certificate authority's key material to a Data Localization Suite region. Changing it forces replacement; omitting it keeps the stored value.
  • zero_trust_gateway_settings: settings.regions for per-region TLS interception and certificate settings.
  • zero_trust_risk_behavior: behaviors.points; behaviors.risk_level is now optional.

New Accepted Values

  • account_subscription: rate_plan.id is no longer limited to the named plans and accepts product rate plan IDs.
  • notification_policy: alert_type accepts 22 new alert types, including billing_budget_alert, magic_endpoint_healthcheck_alert, open_port_scan_alert, closed_port_scan_alert, workers_observability_alert and log_explorer_scheduled_query_results_alert.
  • workers_script: bindings.type accepts worker_loader.
  • zero_trust_device_posture_rule: input.compliance_status accepts conflict and configmanager.

Other

  • queue_consumer: add support for terraform import using <account_id>/<queue_id>/<consumer_id>.
  • r2_custom_domain: add support for terraform import using <account_id>/<bucket_name>/<domain>, optionally followed by /<jurisdiction>.

Bug Fixes

  • access_rule: keep the configured IP or CIDR when the API returns it in another form, such as expanded IPv6.
  • account: send an Idempotency-Key so creating a standalone account no longer fails, and keep standalone in state; stop cloudflare_accounts fetching the same account repeatedly with an account-owned token.
  • account_api_token_permission_groups: return the permission groups instead of null.
  • account_member: fix "Duplicate Set Element" errors when a member holds the same role through more than one policy.
  • address_map: update ips and memberships in place, read ips from the API, and upgrade v4 state.
  • authenticated_origin_pulls_certificate, mtls_certificate: store the configured private key after import; ignore trailing newline differences in certificates after import.
  • bot_management: send and read bot_preference_sync_enabled and cf_robots_variant, and send content_bots_protection; keep planned values when an update response omits them; send ai_training, ai_user and aisearch only when configured.
  • calls_turn_app: populate key from the create response.
  • certificate_pack: stop uploaded_on drift on every refresh.
  • connectivity_directory_service: leave created_at unknown on update, fixing "Provider produced inconsistent result after apply".
  • custom_hostname: stop custom certificate drift and re-upload.
  • dns_record: stop drift on long TXT records and warn on relative names; remove records from state when their zone has been deleted; plan proxiable as unknown when name, type or content changes.
  • email_routing_catch_all, email_routing_rule: stop rules without a name planning an update on every run; keep tag known across updates.
  • hyperdrive_config: leave modified_on unknown when an update is planned.
  • list, notification_policy: keep an empty description on refresh.
  • load_balancer_monitor_group: fix "Provider produced inconsistent result after apply" on every in-place update of description or members.
  • load_balancer_pool: restore an omitted zero port and load-shedding percentages.
  • moq_relay, stream, workers_deployment, zero_trust_access_infrastructure_target, zero_trust_casb_finding_type, zero_trust_tunnel_warp_connector, zone_lockdown: data sources no longer fail with "RFC3339 string value is null" when an optional time filter is unset.
  • notification_policy: keep empty mechanisms.
  • notification_policy_webhooks: keep the configured url when the API returns its redacted display form.
  • observatory_scheduled_test: restore response fields in state.
  • organization: make the cloudflare_organizations data source parent.id filter optional.
  • origin_ca_certificate: stop planning requested_validity after import; do not fail the plan on unknown hostnames; keep revoked_at from state when nothing is replaced.
  • pages_project: read back binding changes made outside Terraform; send whole environment variables on update and stop plan churn; keep an unchanged service binding on update; preserve an empty placement.
  • provider: stop full request bodies occasionally omitting unchanged fields after an earlier partial update in the same run (seen as missing pages_project bindings and dropped fields in other resources); remove resources with dynamic attributes from state when they are deleted outside Terraform.
  • queue_consumer: fix data source reads; keep a configured empty dead_letter_queue.
  • r2_bucket_event_notification: stop drift on every plan; never fail on the queue name lookup.
  • r2_bucket_lock: keep rules in configuration order.
  • ruleset: do not panic when the API returns duplicate rulesets.
  • snippet, snippet_rules: read back snippet code and rules, so changes made outside Terraform show in plans and imports do not re-upload code.
  • spectrum_application: refresh every attribute on read, so changes made outside Terraform show in plans.
  • stream_key: select the resource's signing key on read, import and in the data source; require <account_id>/<key_id> on import; refuse to delete a key the state does not identify.
  • turnstile_widget: keep secret known across in-place updates; changing region now replaces the widget instead of failing.
  • user_group, user_group_members, zone_lockdown: keep the configured order and repeated values on refresh.
  • worker: let deployed_on change when a deploy lands before apply.
  • worker_version: stop API-filled binding environment values forcing replacement, and replan environment when a binding changes target; keep inherit bindings; match bindings by name on read; keep targeted placement from drifting after refresh.
  • workers_cron_trigger: refresh schedules from the API, including on import.
  • workers_kv: return the raw value in the data source, so non-JSON values no longer fail.
  • workers_script: refresh bindings from the API, so bindings changed or removed outside Terraform show in plans; stop re-sending applied Durable Object migrations, which failed later uploads with a migration tag precondition error; keep unset observability defaults out of state.
  • zero_trust_access_ai_controls_mcp_portal: hydrate tool and prompt overrides on read and import and keep only portal-level overrides; skip null servers and keep enabled from older API responses; warn on overrides that set only name; refresh on_behalf correctly.
  • zero_trust_access_ai_controls_mcp_server: stop status drift and empty override churn; do not pin modified_at and modified_by on update.
  • zero_trust_access_application: match mcp and dash_sso settings to the API; plan an app launcher landing_page_design = {} without the default title.
  • zero_trust_access_policy: import state that matches a create from the same configuration; keep reusable and updated_at on a no-op plan; keep an empty purpose_justification_prompt on refresh.
  • zero_trust_connectivity_settings: removing icmp_proxy_enabled or offramp_warp_enabled keeps the current value instead of failing.
  • zero_trust_device_custom_profile: keep gateway_unique_id from state in plans.
  • zero_trust_device_default_profile: plan the replaced split tunnel list as null when switching between include and exclude, and handle empty lists; virtual_networks.allowed and virtual_networks.default may be omitted when updating.
  • zero_trust_device_deployment_groups: read the list once instead of fetching the same page repeatedly.
  • zero_trust_device_posture_rule: keep fields the API omits on refresh, including schedule; warn when a gateway, warp or tanium rule sets an ignored attribute.
  • zero_trust_device_subnet: changing network now replaces the subnet instead of failing.
  • zero_trust_dlp_predefined_profile: read a null confidence_threshold as low.
  • zero_trust_dns_location: fix a value conversion error when max_ttl or networks is unset; default dns64_enabled to false to match the API.
  • zero_trust_gateway_policy: plan removal of rule_settings, schedule and expiration; stop "" -> null diffs on unset description and schedule.time_zone; plan stable read-only attributes from state on update.
  • zero_trust_network_hostname_route: removing comment now clears it instead of failing.
  • zero_trust_tunnel_cloudflared_config: fix "Received unknown value" errors when config is omitted.
  • zero_trust_tunnel_warp_connector: removing ha no longer plans an update the API refuses; refresh ha from the tunnel metadata.
  • zero_trust_tunnel_warp_connector_config: send only planned values, fixing error 1056 when changing ha_mode.
  • zone: stop refresh drift when the API returns permissions in another order.
  • zone_dnssec: keep the configured status while DNSSEC is pending.
  • zone_hold: refresh include_subdomains on the resource and after import.
  • zone_setting: send the full value on update for settings that reset omitted keys; plan no change for an aegis setting that stays disabled.

Documentation

  • guides: remove the incorrect audit_ssh line from the v5 upgrade guide; audit_ssh was removed, not converted to a nested attribute.
  • guides: Terraform < 1.8 users must use terraform state rm and terraform import for renamed resources, since terraform state mv cannot change a resource type; list the renamed resources that cannot be imported; correct the cloudflare_zero_trust_device_default_profile_certificates and cloudflare_zero_trust_gateway_app_types_list names.
  • guides: explain that rule_settings, schedule and expiration on cloudflare_zero_trust_gateway_policy must stay in configuration, and correct the gateway policy rows of the perpetual-diff table.
  • provider: document request pacing and retry defaults and overrides.
  • ruleset: explain fields dropped by typed module variables.
  • workers_script: describe the placement validation rules.
  • zone_setting: explain how tls_1_3 and 0rtt interact; proxy_read_timeout is a string of seconds.

Don't miss a new terraform-provider-cloudflare release

NewReleases is sending notifications on new releases.