---
title: Precursor
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/terraform)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Precursor

#### resource cloudflare\_precursor

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20precursor%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20zone_id>)

##### optional Expand Collapse

Deprecateddefault\_mode?: String

The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule.

[Link to this property](<#(resource)%20precursor%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20default_mode>)

<details>

<summary>

Deprecatedenforcement\_rules?: List\[Attributes]

The ordered list of enforcement rules for the zone.

</summary>

expression: String

The filter expression that determines which requests the rule matches.

<a href="#(resource)%20precursor%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20expression">Link to this property</a>

mode: String

The override mode Precursor applies to requests matching an enforcement rule. Unlike <code>default_mode</code>, this cannot be <code>off</code>.

<a href="#(resource)%20precursor%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20mode">Link to this property</a>

id: String

The read-only identifier that Cloudflare assigns to the rule.

<a href="#(resource)%20precursor%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20id">Link to this property</a>

description?: String

An informative description of the rule.

<a href="#(resource)%20precursor%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20description">Link to this property</a>

enabled?: Bool

Whether the rule is active.

<a href="#(resource)%20precursor%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20enabled">Link to this property</a>

</details>

[Link to this property](<#(resource)%20precursor%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20enforcement_rules>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20precursor%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

### cloudflare\_precursor

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_precursor" "example_precursor" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  default_mode = "min-friction"
  enforcement_rules = [{
    expression = "http.request.uri.path eq \"/login\""
    mode = "max-security"
    description = "Ease friction on the login path"
    enabled = true
  }]
}
```

#### data cloudflare\_precursor

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20precursor%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20zone_id>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20precursor%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

Deprecateddefault\_mode: String

The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule.

[Link to this property](<#(resource)%20precursor%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20default_mode>)

<details>

<summary>

Deprecatedenforcement\_rules: List\[Attributes]

The ordered list of enforcement rules for the zone.

</summary>

expression: String

The filter expression that determines which requests the rule matches.

<a href="#(resource)%20precursor%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20expression">Link to this property</a>

mode: String

The override mode Precursor applies to requests matching an enforcement rule. Unlike <code>default_mode</code>, this cannot be <code>off</code>.

<a href="#(resource)%20precursor%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20mode">Link to this property</a>

id: String

The read-only identifier that Cloudflare assigns to the rule.

<a href="#(resource)%20precursor%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20id">Link to this property</a>

description: String

An informative description of the rule.

<a href="#(resource)%20precursor%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20description">Link to this property</a>

enabled: Bool

Whether the rule is active.

<a href="#(resource)%20precursor%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20enforcement_rules%20%3E%20(attribute)%20enabled">Link to this property</a>

</details>

[Link to this property](<#(resource)%20precursor%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20enforcement_rules>)

### cloudflare\_precursor

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_precursor" "example_precursor" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
```