Terraform 1.2 or newer. We recommend running the latest version for optimal compatibility with the Cloudflare provider. Terraform versions older than 1.2 have known issues with newer features and internals.
Full, comprehensive documentation is available on the Terraform Registry. API documentation and Developer documentation is also available for non-Terraform or service specific information.
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 5"
}
}
}
And initialize your project by running terraform init
.
Do you have an existing Cloudflare account (or many!) that you'd like to transition to be managed via Terraform? Check out cf-terraforming which is a tool Cloudflare has built to help dump the existing resources and import them into Terraform.