Skip to content
Start here

Policies

resource cloudflare_page_shield_policy

required Expand Collapse
zone_id: String

Identifier

action: String

The action to take if the expression matches

description: String

A description for the policy

enabled: Bool

Whether the policy is enabled

expression: String

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

value: String

The policy which will be applied

computed Expand Collapse
id: String

Identifier

cloudflare_page_shield_policy

resource "cloudflare_page_shield_policy" "example_page_shield_policy" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  action = "allow"
  description = "Checkout page CSP policy"
  enabled = true
  expression = "ends_with(http.request.uri.path, \"/checkout\")"
  value = "script-src \'none\';"
}

data cloudflare_page_shield_policy

required Expand Collapse
policy_id: String

Identifier

zone_id: String

Identifier

computed Expand Collapse
id: String

Identifier

action: String

The action to take if the expression matches

description: String

A description for the policy

enabled: Bool

Whether the policy is enabled

expression: String

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

value: String

The policy which will be applied

cloudflare_page_shield_policy

data "cloudflare_page_shield_policy" "example_page_shield_policy" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  policy_id = "023e105f4ecef8ad9ca31a8372d0c353"
}

data cloudflare_page_shield_policies

required Expand Collapse
zone_id: String

Identifier

optional Expand Collapse
max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

Identifier

action: String

The action to take if the expression matches

description: String

A description for the policy

enabled: Bool

Whether the policy is enabled

expression: String

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

value: String

The policy which will be applied

cloudflare_page_shield_policies

data "cloudflare_page_shield_policies" "example_page_shield_policies" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}