You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/terraform/how-to/create-partial-zone.mdx
+22-34Lines changed: 22 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ head:
9
9
content: Create a partial zone using Terraform
10
10
---
11
11
12
+
import { Tabs, TabItem } from"~/components";
13
+
12
14
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).
13
15
14
16
:::caution
@@ -19,66 +21,52 @@ A partial zone cannot be created in the same Cloudflare account as the parent do
19
21
20
22
- Terraform installed. Refer to [Get started](/terraform/installing/).
21
23
- 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.
23
24
24
-
## 1. Create the zone
25
+
## Create the zone
25
26
26
-
Create a `cloudflare_zone` resource with `type = "partial"`. The following example creates a partial zone for `subdomain.example.com`:
27
+
Add the zone configuration and apply the change to create the zone:
Terraform creates the zone in a **Pending** state. You must verify domain ownership before Cloudflare activates it.
39
-
40
-
## 2. Verify domain ownership
41
-
42
-
Create a `TXT` record in your authoritative DNS provider using the `verification_key` output from the zone resource. The record name follows the pattern `cloudflare-verify.<your-subdomain>`.
43
-
44
-
The syntax for this record varies by DNS provider. The following example uses a generic `dns_record` resource:
45
-
38
+
Then, in a new Terraform plan and apply cycle, upgrade the zone to a Business plan or higher:
After applying your configuration, allow time for DNS propagation before the zone becomes active.
62
+
Terraform places the zone in a **Pending** state. You must add the necessary DNS records and verify domain ownership before Cloudflare activates it.
75
63
76
64
:::note
77
-
Refer to the [read-only zone outputs](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zone#read-only) in the Terraform provider documentation when you need to reference other zone properties.
65
+
Refer to the [cloudflare_zone docs](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zone) in the Terraform provider documentation when you need to reference other zone properties.
78
66
:::
79
67
80
68
## Related resources
81
69
82
70
-[Partial zone setup](/dns/zone-setups/partial-setup/)
83
71
-[Convert a full zone to partial](/dns/zone-setups/conversions/convert-full-to-partial/)
Terraform creates the zone in a **Pending** state. You must add NS delegation records to the parent zone before Cloudflare activates it.
35
34
36
-
## 2. Add NS delegation records
37
-
38
-
Create `NS` records in the parent zone that delegate authority to the new secondary zone. Use the `name_servers` output from the zone resource to populate the record values:
After applying your configuration, allow time for DNS propagation before the zone becomes active.
53
-
54
35
:::note
55
-
Refer to the [read-only zone outputs](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zone#read-only) in the Terraform provider documentation when you need to reference other zone properties.
36
+
Refer to the [cloudflare_zone docs](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zone) in the Terraform provider documentation when you need to reference other zone properties.
0 commit comments