Create a partial zone using Terraform
Last updated Apr 21, 2026 A partial zone lets you use Cloudflare for a subdomain while keeping your existing authoritative DNS provider for the parent domain. This guide shows how to automate the setup using the Cloudflare Terraform provider ↗︎.
Caution
A partial zone cannot be created in the same Cloudflare account as the parent domain's full zone.
Prerequisites
- Terraform installed. Refer to Get started.
- Your Cloudflare account ID and a configured provider block. Refer to Initialize Terraform.
Create the zone
Add the zone configuration and apply the change to create the zone:
resource "cloudflare_zone" "subdomain_example_com" {
account = {
id = var.cloudflare_account_id
}
name = "subdomain.example.com"
}
Then, in a new Terraform plan and apply cycle, upgrade the zone to a Business plan or higher:
resource "cloudflare_zone_subscription" "example_zone_subscription" {
zone_id = cloudflare_zone.subdomain_example_com.id
frequency = "monthly"
rate_plan = {
id = "business"
currency = "USD"
}
}
Then, again in a new Terraform plan and apply cycle, update your Terraform configuration to add type = "partial" to the zone:
resource "cloudflare_zone" "subdomain_example_com" {
account = {
id = var.cloudflare_account_id
}
name = "subdomain.example.com"
type = "partial"
}
Terraform places the zone in a Pending state. You must add the necessary DNS records and verify domain ownership before Cloudflare activates it.
Note
Refer to the cloudflare_zone docs ↗︎ in the Terraform provider documentation when you need to reference other zone properties.
Related resources
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/terraform/how-to/create-partial-zone/#page","headline":"Create a partial zone using Terraform","description":"Automate the setup of a Cloudflare partial (CNAME) zone using the Terraform provider.","url":"https://developers.cloudflare.com/terraform/how-to/create-partial-zone/","inLanguage":"en","image":"https://developers.cloudflare.com/terraform/how-to/create-partial-zone/og.png?v=5f17efc5871bf450","dateModified":"2026-04-21","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Automate the setup of a Cloudflare subdomain zone for Enterprise accounts using Terraform. title: Create a subdomain zone using Terraform image: https://developers.cloudflare.com/terraform/how-to/create-secondary-zone/og.png?v=ef45add96f9523a2
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/terraform/llms.txt
Use this file to discover all available pages before exploring further.
Docs