Skip to content
Start here

Rules

resource cloudflare_token_validation_rules

required Expand Collapse
zone_id: String

Identifier.

action: String

Action to take on requests that match operations included in selector and fail expression.

description: String

A human-readable description that gives more details than title.

enabled: Bool

Toggle rule on or off.

expression: String

Rule expression. Requests that fail to match this expression will be subject to action.

For details on expressions, see the Cloudflare Docs.

title: String

A human-readable name for the rule.

selector: Attributes

Select operations covered by this rule.

For details on selectors, see the Cloudflare Docs.

exclude?: List[Attributes]

Ignore operations that were otherwise included by include.

operation_ids?: List[String]

Excluded operation IDs.

include?: List[Attributes]

Select all matching operations.

host?: List[String]

Included hostnames.

optional Expand Collapse
position?: Attributes

Update rule order among zone rules.

index?: Int64

Move rule to this position

before?: String

Move rule to before rule with this ID.

after?: String

Move rule to after rule with this ID.

computed Expand Collapse
id: String

UUID.

created_at: Time
last_updated: Time

cloudflare_token_validation_rules

resource "cloudflare_token_validation_rules" "example_token_validation_rules" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  action = "log"
  description = "Long description for Token Validation Rule"
  enabled = true
  expression = "is_jwt_valid(\"52973293-cb04-4a97-8f55-e7d2ad1107dd\") or is_jwt_valid(\"46eab8d1-6376-45e3-968f-2c649d77d423\")"
  selector = {
    exclude = [{
      operation_ids = ["f9c5615e-fe15-48ce-bec6-cfc1946f1bec", "56828eae-035a-4396-ba07-51c66d680a04"]
    }]
    include = [{
      host = ["v1.example.com", "v2.example.com"]
    }]
  }
  title = "Example Token Validation Rule"
}

data cloudflare_token_validation_rules

required Expand Collapse
zone_id: String

Identifier.

optional Expand Collapse
rule_id?: String

UUID.

filter?: Attributes
id?: String

Select rules with these IDs.

action?: String

Action to take on requests that match operations included in selector and fail expression.

enabled?: Bool

Toggle rule on or off.

host?: String

Select rules with this host in include.

hostname?: String

Select rules with this host in include.

token_configuration?: List[String]

Select rules using any of these token configurations.

computed Expand Collapse
id: String

UUID.

action: String

Action to take on requests that match operations included in selector and fail expression.

created_at: Time
description: String

A human-readable description that gives more details than title.

enabled: Bool

Toggle rule on or off.

expression: String

Rule expression. Requests that fail to match this expression will be subject to action.

For details on expressions, see the Cloudflare Docs.

last_updated: Time
title: String

A human-readable name for the rule.

selector: Attributes

Select operations covered by this rule.

For details on selectors, see the Cloudflare Docs.

exclude: List[Attributes]

Ignore operations that were otherwise included by include.

operation_ids: List[String]

Excluded operation IDs.

include: List[Attributes]

Select all matching operations.

host: List[String]

Included hostnames.

cloudflare_token_validation_rules

data "cloudflare_token_validation_rules" "example_token_validation_rules" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  rule_id = "4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7"
}

data cloudflare_token_validation_rules_list

required Expand Collapse
zone_id: String

Identifier.

optional Expand Collapse
action?: String

Action to take on requests that match operations included in selector and fail expression.

enabled?: Bool

Toggle rule on or off.

host?: String

Select rules with this host in include.

hostname?: String

Select rules with this host in include.

id?: String

Select rules with these IDs.

rule_id?: String

Select rules with these IDs.

token_configuration?: List[String]

Select rules using any of these token configurations.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

action: String

Action to take on requests that match operations included in selector and fail expression.

description: String

A human-readable description that gives more details than title.

enabled: Bool

Toggle rule on or off.

expression: String

Rule expression. Requests that fail to match this expression will be subject to action.

For details on expressions, see the Cloudflare Docs.

selector: Attributes

Select operations covered by this rule.

For details on selectors, see the Cloudflare Docs.

exclude: List[Attributes]

Ignore operations that were otherwise included by include.

operation_ids: List[String]

Excluded operation IDs.

include: List[Attributes]

Select all matching operations.

host: List[String]

Included hostnames.

title: String

A human-readable name for the rule.

id: String

UUID.

created_at: Time
last_updated: Time

cloudflare_token_validation_rules_list

data "cloudflare_token_validation_rules_list" "example_token_validation_rules_list" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  id = "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
  action = "log"
  enabled = true
  host = "www.example.com"
  hostname = "www.example.com"
  rule_id = "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
  token_configuration = ["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"]
}