Skip to content

Commit 4fe5c12

Browse files
pedrosousaMaddy-Cloudflare
authored andcommitted
[WAF] Update code blocks (language, indentation) (#22104)
1 parent 861bbd2 commit 4fe5c12

File tree

1 file changed

+28
-26
lines changed

1 file changed

+28
-26
lines changed

src/content/docs/waf/reference/migration-guides/firewall-rules-to-custom-rules.mdx

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ The recommended steps for replacing your firewall rules (and filters) configurat
158158

159159
1. Run the following command to generate all ruleset configurations for a zone:
160160

161-
```sh null {3,6}
161+
```sh
162162
cf-terraforming generate --zone <ZONE_ID> --resource-type "cloudflare_ruleset"
163+
```
163164

165+
```txt output {1,4}
164166
resource "cloudflare_ruleset" "terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31" {
165167
kind = "zone"
166168
name = "default"
@@ -178,29 +180,29 @@ The recommended steps for replacing your firewall rules (and filters) configurat
178180

179181
3. Import the `cloudflare_ruleset` resource you previously identified into Terraform state using the `terraform import` command. For example:
180182

181-
```sh
182-
terraform import cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31 zone/<ZONE_ID>/3c0b456bc2aa443089c5f40f45f51b31
183-
```
183+
```sh
184+
terraform import cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31 zone/<ZONE_ID>/3c0b456bc2aa443089c5f40f45f51b31
185+
```
184186

185-
```sh output
186-
cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31: Importing from ID "zone/<ZONE_ID>/3c0b456bc2aa443089c5f40f45f51b31"...
187-
cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31: Import prepared!
188-
Prepared cloudflare_ruleset for import
189-
cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31: Refreshing state... [id=3c0b456bc2aa443089c5f40f45f51b31]
187+
```txt output
188+
cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31: Importing from ID "zone/<ZONE_ID>/3c0b456bc2aa443089c5f40f45f51b31"...
189+
cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31: Import prepared!
190+
Prepared cloudflare_ruleset for import
191+
cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31: Refreshing state... [id=3c0b456bc2aa443089c5f40f45f51b31]
190192
191-
Import successful!
193+
Import successful!
192194
193-
The resources that were imported are shown above. These resources are now in
194-
your Terraform state and will henceforth be managed by Terraform.
195-
```
195+
The resources that were imported are shown above. These resources are now in
196+
your Terraform state and will henceforth be managed by Terraform.
197+
```
196198

197199
4. Run `terraform plan` to validate that Terraform now checks the state of the new `cloudflare_ruleset` resource, in addition to other existing resources already managed by Terraform. For example:
198200

199201
```sh
200202
terraform plan
201203
```
202204

203-
```sh output
205+
```txt output
204206
205207
cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31: Refreshing state... [id=3c0b456bc2aa443089c5f40f45f51b31]
206208
[...]
@@ -221,7 +223,7 @@ your Terraform state and will henceforth be managed by Terraform.
221223
terraform state list | grep -E '^cloudflare_(filter|firewall_rule)\.'
222224
```
223225

224-
```sh output
226+
```txt output
225227
cloudflare_filter.my_filter
226228
cloudflare_firewall_rule.my_firewall_rule
227229
```
@@ -232,7 +234,7 @@ your Terraform state and will henceforth be managed by Terraform.
232234
terraform state rm -dry-run cloudflare_filter.my_filter cloudflare_firewall_rule.my_firewall_rule
233235
```
234236

235-
```sh output
237+
```txt output
236238
Would remove cloudflare_filter.my_filter
237239
Would remove cloudflare_firewall_rule.my_firewall_rule
238240
```
@@ -243,7 +245,7 @@ your Terraform state and will henceforth be managed by Terraform.
243245
terraform state rm cloudflare_filter.my_filter cloudflare_firewall_rule.my_firewall_rule
244246
```
245247

246-
```sh output
248+
```txt output
247249
Removed cloudflare_filter.my_filter
248250
Removed cloudflare_firewall_rule.my_firewall_rule
249251
Successfully removed 2 resource instance(s).
@@ -253,18 +255,18 @@ your Terraform state and will henceforth be managed by Terraform.
253255

254256
7. Run `terraform plan` to verify that the resources you deleted from configuration files no longer appear. You should not have any pending changes.
255257

256-
```sh
257-
terraform plan
258-
```
258+
```sh
259+
terraform plan
260+
```
259261

260-
```sh output
261-
cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31: Refreshing state... [id=3c0b456bc2aa443089c5f40f45f51b31]
262-
[...]
262+
```txt output
263+
cloudflare_ruleset.terraform_managed_resource_3c0b456bc2aa443089c5f40f45f51b31: Refreshing state... [id=3c0b456bc2aa443089c5f40f45f51b31]
264+
[...]
263265
264-
No changes. Your infrastructure matches the configuration.
266+
No changes. Your infrastructure matches the configuration.
265267
266-
Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
267-
```
268+
Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
269+
```
268270

269271
For details on importing Cloudflare resources to Terraform and using the `cf-terraforming` tool, refer to the following resources:
270272

0 commit comments

Comments
 (0)