Cloudflare's Terraform v5 provider clears out its backlog of bugs in v5.4.0!
Hey everyone, it's me, Shii-chan! Today's news is about Cloudflare's Terraform provider. It might sound like a dry topic, but if you're running Cloudflare through IaC, this is a genuinely welcome update.
Cloudflare ChangelogWhat was announced?
On the Cloudflare Changelog, the Terraform v5 provider's v5.4.0 release was announced. It's a bug-fix release that bundles up fixes for issues that had been piling up since the v5 provider launched earlier this year.
The story so far
Unlike earlier hand-written providers, the v5 provider is automatically generated from the OpenAPI schemas behind Cloudflare's REST APIs. After launch, though, an unexpectedly high number of issues came in from customers, impacting about 15% of all resources. Cloudflare pulled in teams from across the company to work through the backlog.
What changes
v5.4.0 bundles fixes for the reported issues. Here are the main changes.
- Removes the
worker_platforms_script_secretresource (a migration guide is provided for both Workers and Workers for Platforms) - Removes duplicated fields in
cloudflare_cloud_connector_rules - Fixes
cloudflare_workers_routeid issues (GitHub issues #5134 and #5501) - Fixes
cloudflare_workers_kvstate refresh issues - Fixes defaults that made
cloudflare_workers_scriptfail when using Assets - Fixes the Workers Logpush setting in
cloudflare_workers_scriptmistakenly being read-only - Fixes
cloudflare_pages_projectbreaking when usingsource
If you've been hitting these bugs on v5 already, upgrading the provider should clear up most of them.
Dive Deep
The two biggest chunks of fixes here are a bug where refreshing resources with unsupported response types would fail, and a bug where nested properties without computed values couldn't be configured.
The response-type refresh bug affected these resources.
cloudflare_certificate_packcloudflare_registrar_domaincloudflare_stream_downloadcloudflare_stream_webhookcloudflare_usercloudflare_workers_kvcloudflare_workers_script
And the nested-property configurability bug spanned a full 33 resources.
cloudflare_accountcloudflare_account_dns_settingscloudflare_account_tokencloudflare_api_tokencloudflare_cloud_connector_rulescloudflare_custom_sslcloudflare_d1_databasecloudflare_dns_recordemail_security_trusted_domainscloudflare_hyperdrive_configcloudflare_keyless_certificatecloudflare_list_itemcloudflare_load_balancercloudflare_logpush_dataset_jobcloudflare_magic_network_monitoring_configurationcloudflare_magic_transit_sitecloudflare_magic_transit_site_lancloudflare_magic_transit_site_wancloudflare_magic_wan_static_routecloudflare_notification_policycloudflare_pages_projectcloudflare_queuecloudflare_queue_consumercloudflare_r2_bucket_corscloudflare_r2_bucket_event_notificationcloudflare_r2_bucket_lifecyclecloudflare_r2_bucket_lockcloudflare_r2_bucket_sippycloudflare_rulesetcloudflare_snippet_rulescloudflare_snippetscloudflare_spectrum_applicationcloudflare_workers_deploymentcloudflare_zero_trust_access_applicationcloudflare_zero_trust_access_group
That list spans DNS records, load balancers, R2 buckets, and Zero Trust resources, so it's a genuinely wide-reaching set of fixes. The full changelog is available in the v5.4.0 release notes on GitHub.
For anyone considering a move from v4 to v5, there's a migration guide along with automated migration scripts built on Grit. Those scripts don't support setups that use Terraform modules, though, so module users will need to migrate manually. Cloudflare also recommends running terraform plan to review the diff before applying.
Wrap-up
- Cloudflare's Terraform v5 provider ships v5.4.0, bundling fixes for previously reported bugs
- Removes the
worker_platforms_script_secretresource, and fixescloudflare_workers_routeid issues andcloudflare_workers_kvstate refresh problems, among others - Fixes a refresh bug affecting 7 resources and a nested-property configurability bug affecting 33 resources
- Provides a migration guide and Grit-based automated scripts for v4-to-v5 migrations (manual migration still needed if you use Terraform modules)
If you're already running Cloudflare through Terraform, upgrading to v5.4.0 is worth doing!