Skip to content
Start here

Rules

resource cloudflare_snippet_rules

required Expand Collapse
zone_id: String

Use this field to specify the unique ID of the zone.

rules: List[Attributes]

Lists snippet rules.

id: String

Specify the unique ID of the rule.

expression: String

Define the expression that determines which traffic matches the rule.

last_updated: Time

Specify the timestamp of when the rule was last modified.

snippet_name: String

Identify the snippet.

description?: String

Provide an informative description of the rule.

enabled?: Bool

Indicate whether to execute the rule.

cloudflare_snippet_rules

resource "cloudflare_snippet_rules" "example_snippet_rules" {
  zone_id = "9f1839b6152d298aca64c4e906b6d074"
  rules = [{
    expression = "ip.src eq 1.1.1.1"
    snippet_name = "my_snippet"
    description = "Execute my_snippet when IP address is 1.1.1.1."
    enabled = true
  }]
}