Skip to content

Commit 71b34a0

Browse files
committed
chore: add normal partial zone creation flow
1 parent 3285f46 commit 71b34a0

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

src/content/docs/terraform/how-to/create-partial-zone.mdx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ head:
99
content: Create a partial zone using Terraform
1010
---
1111

12+
import { Tabs, TabItem } from "~/components";
13+
1214
A [partial zone](/dns/zone-setups/partial-setup/) 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](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs).
1315

1416
:::caution
@@ -19,11 +21,33 @@ A partial zone cannot be created in the same Cloudflare account as the parent do
1921

2022
- Terraform installed. Refer to [Get started](/terraform/installing/).
2123
- Your Cloudflare account ID and a configured provider block. Refer to [Initialize Terraform](/terraform/tutorial/initialize-terraform/).
22-
- Partial zone entitlement enabled on your account. Contact your Cloudflare account team to confirm.
2324

24-
## 1. Create the zone
25+
## Create the zone
26+
27+
Add the zone configuration and apply the change to create the zone:
28+
29+
```hcl
30+
resource "cloudflare_zone" "subdomain_example_com" {
31+
account = {
32+
id = var.cloudflare_account_id
33+
}
34+
name = "subdomain.example.com"
35+
}
36+
```
37+
38+
Then, in a new Terraform plan and apply cycle, upgrade the zone to a Business plan or higher:
39+
```hcl
40+
resource "cloudflare_zone_subscription" "example_zone_subscription" {
41+
zone_id = cloudflare_zone.subdomain_example_com.id
42+
frequency = "monthly"
43+
rate_plan = {
44+
id = "business"
45+
currency = "USD"
46+
}
47+
}
48+
```
2549

26-
Create a `cloudflare_zone` resource with `type = "partial"`. The following example creates a partial zone for `subdomain.example.com`:
50+
Then, again in a new Terraform plan and apply cycle, update your Terraform configuration to add `type = "partial"` to the zone:
2751

2852
```hcl
2953
resource "cloudflare_zone" "subdomain_example_com" {
@@ -35,7 +59,7 @@ resource "cloudflare_zone" "subdomain_example_com" {
3559
}
3660
```
3761

38-
Terraform creates the zone in a **Pending** state. You must verify domain ownership before Cloudflare activates it.
62+
Terraform places the zone in a **Pending** state. You must verify domain ownership before Cloudflare activates it.
3963

4064
## 2. Verify domain ownership
4165

@@ -81,4 +105,4 @@ Refer to the [read-only zone outputs](https://registry.terraform.io/providers/cl
81105

82106
- [Partial zone setup](/dns/zone-setups/partial-setup/)
83107
- [Convert a full zone to partial](/dns/zone-setups/conversions/convert-full-to-partial/)
84-
- [`cloudflare_zone` resource](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zone)
108+
- [`cloudflare_zone` resource](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zone)

src/content/docs/terraform/how-to/create-secondary-zone.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ A [secondary zone](/dns/zone-setups/subdomain-setup/) lets you manage a subdomai
1515

1616
- Terraform installed. Refer to [Get started](/terraform/installing/).
1717
- Your Cloudflare account ID and a configured provider block. Refer to [Initialize Terraform](/terraform/tutorial/initialize-terraform/).
18-
- Secondary zone entitlement enabled on your account. Contact your Cloudflare account team to confirm.
1918

2019
## 1. Create the zone
2120

@@ -59,4 +58,4 @@ Refer to the [read-only zone outputs](https://registry.terraform.io/providers/cl
5958

6059
- [Subdomain setup](/dns/zone-setups/subdomain-setup/)
6160
- [`cloudflare_zone` resource](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zone)
62-
- [`cloudflare_dns_record` resource](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/dns_record)
61+
- [`cloudflare_dns_record` resource](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/dns_record)

0 commit comments

Comments
 (0)