Skip to content

Commit 4e2c316

Browse files
ranbelRebeccaTamachiro
authored andcommitted
[ZT] update Terraform examples to v5 (#21747)
* update Entra ID example * update ZT org example * update entra ID page * update OTP * generic OIDC and SAML examples
1 parent c39281d commit 4e2c316

File tree

7 files changed

+21
-51
lines changed

7 files changed

+21
-51
lines changed

src/content/docs/cloudflare-one/identity/idp-integration/entra-id.mdx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,16 @@ To [test](/cloudflare-one/identity/idp-integration/#test-idps-in-zero-trust) tha
139139
}'
140140
```
141141

142-
</TabItem> <TabItem label="Terraform">
142+
</TabItem> <TabItem label="Terraform (v5)">
143143

144-
:::note[Provider versions]
145-
The following example requires Cloudflare provider version `>=4.40.0`.
146-
:::
147144

148145
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
149146

150147
- `Access: Organizations, Identity Providers, and Groups Write`
151148

152149
2. Configure the [`cloudflare_zero_trust_access_identity_provider`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_access_identity_provider) resource:
153150

154-
<Render file="access/entra-id-terraform" />
151+
<Render file="access/entra-id-terraform" />
155152

156153
</TabItem> </Tabs>
157154

src/content/docs/cloudflare-one/identity/idp-integration/generic-oidc.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,7 @@ Cloudflare Access has a generic OpenID Connect (OIDC) connector to help you inte
8080
}'
8181
```
8282

83-
</TabItem> <TabItem label="Terraform">
84-
85-
:::note[Provider versions]
86-
The following example requires Cloudflare provider version `>=4.40.0`.
87-
:::
83+
</TabItem> <TabItem label="Terraform (v5)">
8884

8985
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
9086
- `Access: Organizations, Identity Providers, and Groups Write`
@@ -96,7 +92,7 @@ The following example requires Cloudflare provider version `>=4.40.0`.
9692
account_id = var.cloudflare_account_id
9793
name = "Generic OIDC example"
9894
type = "oidc"
99-
config {
95+
config = {
10096
client_id = "<your client id>"
10197
client_secret = "<your client secret>"
10298
auth_url = "https://accounts.google.com/o/oauth2/auth"

src/content/docs/cloudflare-one/identity/idp-integration/generic-saml.mdx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ To download the SAML metadata file, copy-paste the metadata endpoint into a web
5353
6. (Optional) Under **Optional configurations**, configure [additional SAML options](#optional-configurations).
5454
7. Select **Save**.
5555

56-
</TabItem> <TabItem label="Terraform">
57-
58-
:::note[Provider versions]
59-
The following example requires Cloudflare provider version `>=4.40.0`.
60-
:::
56+
</TabItem> <TabItem label="Terraform (v5)">
6157

6258
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
6359

@@ -70,10 +66,10 @@ The following example requires Cloudflare provider version `>=4.40.0`.
7066
account_id = var.cloudflare_account_id
7167
name = "Generic SAML example"
7268
type = "saml"
73-
config {
69+
config = {
7470
sso_target_url = "https://example.com/1234/sso/saml"
7571
issuer_url = "https://example.com/1234"
76-
idp_public_cert = "-----BEGIN CERTIFICATE-----\nXXXXX\n-----END CERTIFICATE-----"
72+
idp_public_certs = ["-----BEGIN CERTIFICATE-----\nXXXXX\n-----END CERTIFICATE-----"]
7773
sign_request = false
7874
email_attribute_name = "email"
7975
attributes = ["employeeID", "groups"]

src/content/docs/cloudflare-one/identity/one-time-pin.mdx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ For example, if your team uses Okta but you are collaborating with someone outsi
4040
}'
4141
```
4242

43-
</TabItem> <TabItem label="Terraform">
44-
45-
:::note[Provider versions]
46-
The following example requires Cloudflare provider version `>=4.40.0`.
47-
:::
43+
</TabItem> <TabItem label="Terraform (v5)">
4844

4945
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
5046
- `Access: Organizations, Identity Providers, and Groups Write`
@@ -56,9 +52,10 @@ The following example requires Cloudflare provider version `>=4.40.0`.
5652
account_id = var.cloudflare_account_id
5753
name = "One-time PIN login"
5854
type = "onetimepin"
55+
config = {}
5956
}
6057
```
61-
</TabItem> </Tabs>
58+
</TabItem></Tabs>
6259

6360
:::tip
6461
If your organization uses a third-party email scanning service (for example, Mimecast or Barracuda), add `[email protected]` to the email scanning allowlist.

src/content/partials/cloudflare-one/access/entra-id-terraform.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ resource "cloudflare_zero_trust_access_identity_provider" "microsoft_entra_id" {
88
account_id = var.cloudflare_account_id
99
name = "Entra ID example"
1010
type = "azureAD"
11-
config {
11+
config = {
1212
client_id = var.entra_id_client_id
1313
client_secret = var.entra_id_client_secret
1414
directory_id = var.entra_id_directory_id
1515
support_groups = true
16-
}
16+
}
1717
}
1818
```

src/content/partials/cloudflare-one/access/idp-integration.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import {Render, Tabs, TabItem} from "~/components"
2020

2121
5. Once you have filled in the necessary fields, select **Save**.
2222

23-
</TabItem> <TabItem label="Terraform">
23+
</TabItem> <TabItem label="Terraform (v5)">
2424

2525
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
2626
- `Access: Organizations, Identity Providers, and Groups Write`
2727

28-
2. Add an identity provider to Zero Trust using the [`cloudflare_zero_trust_access_identity_provider`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_access_identity_provider) resource. For example, to add a Microsoft Entra ID integration:
28+
2. Add an identity provider to Zero Trust using the [`cloudflare_zero_trust_access_identity_provider`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_access_identity_provider) resource. For example, to add a Microsoft Entra ID integration:
2929

3030
<Render file="access/entra-id-terraform" product="cloudflare-one" />
3131

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

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
---
55

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

88
To start using Zero Trust features, create a Zero Trust organization in your Cloudflare account.
99

@@ -17,41 +17,25 @@ To create a Zero Trust organization:
1717

1818
You can use the [Cloudflare Terraform provider](https://registry.terraform.io/providers/cloudflare/cloudflare/latest) to manage your Zero Trust organization alongside your other IT infrastructure. To get started with Terraform, refer to our [Terraform tutorial series](/terraform/tutorial/).
1919

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/).
20+
To add Zero Trust to your Terraform configuration:
2121

22-
To import your Zero Trust organization:
22+
1. [Sign up for Zero Trust](#sign-up-for-zero-trust) on the Cloudflare dashboard.
2323

24-
<Tabs> <TabItem label="Terraform (v4)">
25-
26-
:::note[Provider versions]
27-
The following example requires Cloudflare provider version `>=4.40.0`.
28-
:::
29-
30-
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/4.40.0/docs/resources/api_token):
24+
2. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
3125
- `Access: Organizations, Identity Providers, and Groups Write`
3226

33-
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:
27+
3. Add the [`cloudflare_zero_trust_organization`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_organization) resource:
3428

3529
```terraform
36-
resource "cloudflare_zero_trust_access_organization" "<your-team-name>" {
30+
resource "cloudflare_zero_trust_organization" "<your-team-name>" {
3731
account_id = var.cloudflare_account_id
3832
name = "Acme Corporation"
3933
auth_domain = "<your-team-name>.cloudflareaccess.com"
4034
}
4135
```
4236
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**.
4337

44-
3. In a terminal, run:
45-
46-
```sh
47-
terraform import cloudflare_zero_trust_access_organization.<your-team-name> <cloudflare_account_id>`
48-
```
49-
50-
</TabItem>
51-
52-
</Tabs>
53-
54-
You can now update the Zero Trust organization using Terraform.
38+
You can now update Zero Trust organization settings using Terraform.
5539

5640
:::tip
5741
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).

0 commit comments

Comments
 (0)