The Cloudflare Terraform provider exposes Cloudflare account and zone settings to Terraform through the Cloudflare REST API.
Overview
The Cloudflare Terraform provider connects Terraform configurations to Cloudflare’s REST API so DNS, zones, access controls, and related Cloudflare objects can be declared as code. It is distributed on the Terraform Registry under the cloudflare namespace.
You add provider requirements to Terraform, initialize the project with terraform init, and configure credentials via provider options or environment variables such as API tokens, keys, email, account ID, and zone ID. Additional examples ship in the provider repository and extended docs live on the registry.
The provider expects Terraform CLI 1.0 or newer. Maintenance is handled by Cloudflare with auto-generated SDK sources; community pull requests are limited though issues are accepted for bugs and features.
It is a client plugin used alongside Terraform when managing Cloudflare services, not software that hosts Cloudflare infrastructure locally.
Key features
- Cloudflare REST API integration
- API token and key authentication
- Environment variable credential support
- Terraform Registry distribution
- Example configurations included
- Account and zone ID options
- Semantic versioning policy
- Active Cloudflare maintenance
Use cases
- DNS and zone automation
- Cloudflare config as code
- Token-based CI deployments
- Multi-account Cloudflare management
- Infrastructure alongside other providers