Skip to content

Commit 591bb82

Browse files
committed
Import ZT org into Terraform
1 parent cb8c582 commit 591bb82

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

src/content/partials/learning-paths/zero-trust/create-zero-trust-org.mdx

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,52 @@
33

44
---
55

6-
import { Render } from "~/components"
6+
import { Render, Tabs, TabItem} from "~/components"
77

8-
To set up a Zero Trust organization:
8+
To start using Zero Trust features, create a Zero Trust organization in your Cloudflare account.
9+
10+
## Sign up for Zero Trust
11+
12+
To create a Zero Trust organization:
913

1014
<Render file="choose-team-name" product="cloudflare-one" />
15+
16+
## (Optional) Manage Zero Trust in Terraform
17+
18+
You can use the [Cloudflare Terraform provider](https://registry.terraform.io/providers/cloudflare/cloudflare/4.40.0) to manage your Zero Trust organization alongside your other IT infrastructure. To get started with Terraform, refer to our [Terraform tutorial series](/terraform/tutorial/).
19+
20+
Zero Trust organizations cannot be created through Terraform. You must [sign up for Zero Trust](#sign-up-for-zero-trust) on the Cloudflare dashboard and then import the resource into your [Terraform configuration](/terraform/).
21+
22+
To import your Zero Trust organization:
23+
24+
<Tabs> <TabItem label="Terraform (v4)">
25+
26+
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/4.40.0/docs/resources/api_token):
27+
- `Access: Organizations, Identity Providers, and Groups Write`
28+
29+
2. Add the [`cloudflare_zero_trust_access_organization`](https://registry.terraform.io/providers/cloudflare/cloudflare/4.40.0/docs/resources/zero_trust_access_organization) resource:
30+
31+
```terraform
32+
resource "cloudflare_zero_trust_access_organization" "<your-team-name>" {
33+
account_id = var.cloudflare_account_id
34+
name = "<your-team-name>"
35+
auth_domain = "<your-team-name>.cloudflareaccess.com"
36+
}
37+
```
38+
Replace `<your-team-name` with the Zero Trust organization name selected during [onboarding](#sign-up-for-zero-trust). You can also view your team name on [Zero Trust](https://one.dash.cloudflare.com) under **Settings** > **Custom Pages**.
39+
40+
3. In a terminal, run:
41+
42+
```sh
43+
terraform import cloudflare_zero_trust_access_organization.<your-team-name> <cloudflare_account_id>`
44+
```
45+
46+
</TabItem>
47+
48+
</Tabs>
49+
50+
You can now update the Zero Trust organization using Terraform.
51+
52+
:::tip
53+
If you plan to manage all Zero Trust settings in Terraform, set the dashboard to [API/Terraform read-only mode](/cloudflare-one/api-terraform/#set-dashboard-to-read-only).
54+
:::

0 commit comments

Comments
 (0)