Terraform v5 Provider Bug Squash Continues: v5.5.0 Is Here!
Hey, it's me! Today I've got an update on Cloudflare's Terraform provider for you. It might sound like a small release, but it's great news if you manage Cloudflare with infrastructure as code!
Cloudflare ChangelogWhat was announced?
According to the Cloudflare Changelog, a new version of the Terraform provider, v5.5.0, has been released. This time the headline isn't a new feature — it's a batch of fixes for known bugs in the v5 provider.
The story so far
Earlier this year, Cloudflare announced the new Terraform v5 provider. Unlike earlier providers, it's built differently: v5 is automatically generated from the OpenAPI schemas for Cloudflare's REST APIs.
But since launch, customers have reported an unexpectedly high number of issues, and according to the source, these issues currently affect about 15% of resources. Cloudflare says teams across the company have been working to address them.
What changes
v5.5.0 includes broad fixes for resources that kept producing perpetual diffs (changes detected every time you run terraform plan even though nothing actually changed). The affected resources are:
cloudflare_zero_trust_gateway_policycloudflare_zero_trust_access_applicationcloudflare_zero_trust_tunnel_cloudflared_routecloudflare_zone_settingcloudflare_rulesetcloudflare_page_rule
If you manage these with Terraform, you should no longer be bothered by meaningless diffs. Client errors on reapplying zone settings and conversion errors for page rules have also been fixed.
Dive Deep
Here are the specific GitHub issues closed in this release:
- Importing a Zero Trust gateway policy errored on an attribute filter value (#5304)
- Importing a page rule didn't populate all fields in the Terraform state (#5303)
- Creating a page rule with a redirect failed (#5178)
- Turnstile widgets couldn't be updated (#5336)
- The result object became invalid after applying a Cloud Connector rule (#5418)
- Zone setting
always_use_httpserrored with an invalid value (#5423)
There's also guidance for anyone who hasn't migrated from v4 to v5 yet: an official migration guide is available, along with an automated migration script built with Grit. One limitation: environments that use Terraform modules aren't covered by the automation and need manual migration. Before upgrading, it's recommended to review the changes with terraform plan before applying.
Wrap-up
Here's the quick recap:
- The Terraform v5 provider is auto-generated from OpenAPI schemas
- After launch, about 15% of resources had reported issues
- v5.5.0 fixes perpetual diffs and errors across several resources, including gateway policies and page rules
- Six related GitHub issues were closed
- Migrating from v4 to v5 has an official guide and an automated script (manual work needed if you use modules)
If you're running Cloudflare with Terraform and have been fighting with v5 provider diffs, this is a good time to upgrade!