Skip to content

Commit 1f42004

Browse files
committed
[Terraform] Update page about rule ID changes
1 parent 97b71f3 commit 1f42004

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/content/docs/terraform/troubleshooting/rule-id-changes.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
label: Rule ID changes
66
---
77

8-
For [`cloudflare_ruleset`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/ruleset) resources, the Cloudflare provider may delete a rule and create a new one when you modify a ruleset rule in your Terraform configuration. This happens when the provider cannot match your new rule configuration in Terraform with an existing rule in your Cloudflare configuration. In this situation, modifying a rule in your Terraform configuration and applying the changes will create a new rule with a different rule ID in your Cloudflare account or zone.
8+
For [`cloudflare_ruleset`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/ruleset) resources, the Cloudflare provider may delete a rule and create a new one when you modify a ruleset rule in your Terraform configuration. This happens because the API cannot match rules in your new Terraform configuration with existing rules in your Cloudflare configuration. Modifying a rule in your Terraform configuration and applying the changes will create a new rule with a different rule ID in your Cloudflare account or zone.
99

1010
This behavior may have an impact on any automation or monitoring systems you may have configured that rely on having immutable rule IDs between rule modifications.
1111

@@ -17,9 +17,11 @@ The `ref` field is a user-defined external identifier that must be unique for ea
1717

1818
`ref` values have a string data type with a minimum length of one character. For example, `my_ref`.
1919

20+
Once you set the `ref` field of a rule, changing the `ref` field value will make Terraform create a new rule.
21+
2022
## `cf-terraforming` support for `ref` field values
2123

22-
By default, when you create a rule, its `ref` value will be equal to the rule ID. You can set or modify `ref` values via Cloudflare API.
24+
By default, when you create a rule, its `ref` value will be equal to the rule ID. You can set `ref` values via Cloudflare API.
2325

2426
When you [import your existing Cloudflare configuration to Terraform](/terraform/advanced-topics/import-cloudflare-resources/) using [`cf-terraforming`](https://github.com/cloudflare/cf-terraforming), the generated Terraform configuration will have `ref` values for each rule, with the same value as the rule ID.
2527

0 commit comments

Comments
 (0)