Skip to content
Start here

Rules

resource cloudflare_email_routing_rule

required Expand Collapse
zone_id: String

Identifier.

actions: List[Attributes]

List actions patterns.

type: String

Type of supported action.

value?: List[String]
matchers: List[Attributes]

Matching patterns to forward to your actions.

type: String

Type of matcher.

field?: String

Field for type matcher.

value?: String

Value for matcher.

optional Expand Collapse
name?: String

Routing rule name.

owner_worker_tag?: String

Public tag (script_tag) of the Worker that owns this rule. Required when source is wrangler.

enabled?: Bool

Routing rule status.

priority?: Float64

Priority of the routing rule.

source?: String

Who manages the rule. api covers dashboard, generic API, and Terraform; wrangler means the rule is managed by a Worker’s wrangler.jsonc. Defaults to api when omitted on write.

computed Expand Collapse
id: String

Routing rule identifier.

Deprecatedtag: String

Routing rule tag. (Deprecated, replaced by routing rule identifier)

cloudflare_email_routing_rule

resource "cloudflare_email_routing_rule" "example_email_routing_rule" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  actions = [{
    type = "forward"
    value = ["destinationaddress@example.net"]
  }]
  matchers = [{
    type = "literal"
    field = "to"
    value = "test@example.com"
  }]
  enabled = true
  name = "Send to user@example.net rule."
  owner_worker_tag = "a7e6fb77503c41d8a7f3113c6918f10c"
  priority = 0
  source = "api"
}

data cloudflare_email_routing_rule

required Expand Collapse
rule_identifier: String

Routing rule identifier.

zone_id: String

Identifier.

computed Expand Collapse
id: String

Routing rule identifier.

enabled: Bool

Routing rule status.

name: String

Routing rule name.

priority: Float64

Priority of the routing rule.

source: String

Who manages the rule. api covers dashboard, generic API, and Terraform; wrangler means the rule is managed by a Worker’s wrangler.jsonc. Defaults to api when omitted on write.

Deprecatedtag: String

Routing rule tag. (Deprecated, replaced by routing rule identifier)

actions: List[Attributes]

List actions patterns.

type: String

Type of supported action.

value: List[String]
matchers: List[Attributes]

Matching patterns to forward to your actions.

type: String

Type of matcher.

field: String

Field for type matcher.

value: String

Value for matcher.

cloudflare_email_routing_rule

data "cloudflare_email_routing_rule" "example_email_routing_rule" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  rule_identifier = "a7e6fb77503c41d8a7f3113c6918f10c"
}

data cloudflare_email_routing_rules

optional Expand Collapse
account_id?: String

The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

zone_id?: String

The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

enabled?: Bool

Filter by enabled routing rules.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

Routing rule identifier.

actions: List[Attributes]

List actions patterns.

type: String

Type of supported action.

value: List[String]
enabled: Bool

Routing rule status.

matchers: List[Attributes]

Matching patterns to forward to your actions.

type: String

Type of matcher.

field: String

Field for type matcher.

value: String

Value for matcher.

name: String

Routing rule name.

priority: Float64

Priority of the routing rule.

source: String

Who manages the rule. api covers dashboard, generic API, and Terraform; wrangler means the rule is managed by a Worker’s wrangler.jsonc. Defaults to api when omitted on write.

Deprecatedtag: String

Routing rule tag. (Deprecated, replaced by routing rule identifier)

zone: Attributes

Zone information for the routing rule.

name: String

Zone name.

tag: String

Zone tag.

cloudflare_email_routing_rules

data "cloudflare_email_routing_rules" "example_email_routing_rules" {
  account_id = "account_id"
  zone_id = "zone_id"
  enabled = true
}

RulesCatch Alls

resource cloudflare_email_routing_catch_all

required Expand Collapse
zone_id: String

Identifier.

actions: List[Attributes]

List actions for the catch-all routing rule.

type: String

Type of action for catch-all rule.

value?: List[String]
matchers: List[Attributes]

List of matchers for the catch-all routing rule.

type: String

Type of matcher. Default is ‘all’.

optional Expand Collapse
name?: String

Routing rule name.

owner_worker_tag?: String

Public tag (script_tag) of the Worker that owns this rule. Required when source is wrangler.

enabled?: Bool

Routing rule status.

source?: String

Who manages the rule. api covers dashboard, generic API, and Terraform; wrangler means the rule is managed by a Worker’s wrangler.jsonc. Defaults to api when omitted on write.

computed Expand Collapse
id: String

Identifier.

Deprecatedtag: String

Routing rule tag. (Deprecated, replaced by routing rule identifier)

cloudflare_email_routing_catch_all

resource "cloudflare_email_routing_catch_all" "example_email_routing_catch_all" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  actions = [{
    type = "forward"
    value = ["destinationaddress@example.net"]
  }]
  matchers = [{
    type = "all"
  }]
  enabled = true
  name = "Send to user@example.net rule."
  owner_worker_tag = "a7e6fb77503c41d8a7f3113c6918f10c"
  source = "api"
}

data cloudflare_email_routing_catch_all

required Expand Collapse
zone_id: String

Identifier.

computed Expand Collapse
id: String

Identifier.

enabled: Bool

Routing rule status.

name: String

Routing rule name.

source: String

Who manages the rule. api covers dashboard, generic API, and Terraform; wrangler means the rule is managed by a Worker’s wrangler.jsonc. Defaults to api when omitted on write.

Deprecatedtag: String

Routing rule tag. (Deprecated, replaced by routing rule identifier)

actions: List[Attributes]

List actions for the catch-all routing rule.

type: String

Type of action for catch-all rule.

value: List[String]
matchers: List[Attributes]

List of matchers for the catch-all routing rule.

type: String

Type of matcher. Default is ‘all’.

cloudflare_email_routing_catch_all

data "cloudflare_email_routing_catch_all" "example_email_routing_catch_all" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}