1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. EmailRoutingRule
Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi

cloudflare.EmailRoutingRule

Explore with Pulumi AI

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
  exampleEmailRoutingRule:
    type: cloudflare:EmailRoutingRule
    name: example_email_routing_rule
    properties:
      zoneId: 023e105f4ecef8ad9ca31a8372d0c353
      actions:
        - type: drop
          value:
            - destinationaddress@example.net
      matchers:
        - field: to
          type: literal
          value: test@example.com
      enabled: true
      name: Send to user@example.net rule.
      priority: 0
Copy

Create EmailRoutingRule Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new EmailRoutingRule(name: string, args: EmailRoutingRuleArgs, opts?: CustomResourceOptions);
@overload
def EmailRoutingRule(resource_name: str,
                     args: EmailRoutingRuleArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def EmailRoutingRule(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     actions: Optional[Sequence[EmailRoutingRuleActionArgs]] = None,
                     matchers: Optional[Sequence[EmailRoutingRuleMatcherArgs]] = None,
                     zone_id: Optional[str] = None,
                     enabled: Optional[bool] = None,
                     name: Optional[str] = None,
                     priority: Optional[float] = None)
func NewEmailRoutingRule(ctx *Context, name string, args EmailRoutingRuleArgs, opts ...ResourceOption) (*EmailRoutingRule, error)
public EmailRoutingRule(string name, EmailRoutingRuleArgs args, CustomResourceOptions? opts = null)
public EmailRoutingRule(String name, EmailRoutingRuleArgs args)
public EmailRoutingRule(String name, EmailRoutingRuleArgs args, CustomResourceOptions options)
type: cloudflare:EmailRoutingRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. EmailRoutingRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. EmailRoutingRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. EmailRoutingRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. EmailRoutingRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. EmailRoutingRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var emailRoutingRuleResource = new Cloudflare.EmailRoutingRule("emailRoutingRuleResource", new()
{
    Actions = new[]
    {
        new Cloudflare.Inputs.EmailRoutingRuleActionArgs
        {
            Type = "string",
            Values = new[]
            {
                "string",
            },
        },
    },
    Matchers = new[]
    {
        new Cloudflare.Inputs.EmailRoutingRuleMatcherArgs
        {
            Field = "string",
            Type = "string",
            Value = "string",
        },
    },
    ZoneId = "string",
    Enabled = false,
    Name = "string",
    Priority = 0,
});
Copy
example, err := cloudflare.NewEmailRoutingRule(ctx, "emailRoutingRuleResource", &cloudflare.EmailRoutingRuleArgs{
	Actions: cloudflare.EmailRoutingRuleActionArray{
		&cloudflare.EmailRoutingRuleActionArgs{
			Type: pulumi.String("string"),
			Values: pulumi.StringArray{
				pulumi.String("string"),
			},
		},
	},
	Matchers: cloudflare.EmailRoutingRuleMatcherArray{
		&cloudflare.EmailRoutingRuleMatcherArgs{
			Field: pulumi.String("string"),
			Type:  pulumi.String("string"),
			Value: pulumi.String("string"),
		},
	},
	ZoneId:   pulumi.String("string"),
	Enabled:  pulumi.Bool(false),
	Name:     pulumi.String("string"),
	Priority: pulumi.Float64(0),
})
Copy
var emailRoutingRuleResource = new EmailRoutingRule("emailRoutingRuleResource", EmailRoutingRuleArgs.builder()
    .actions(EmailRoutingRuleActionArgs.builder()
        .type("string")
        .values("string")
        .build())
    .matchers(EmailRoutingRuleMatcherArgs.builder()
        .field("string")
        .type("string")
        .value("string")
        .build())
    .zoneId("string")
    .enabled(false)
    .name("string")
    .priority(0)
    .build());
Copy
email_routing_rule_resource = cloudflare.EmailRoutingRule("emailRoutingRuleResource",
    actions=[{
        "type": "string",
        "values": ["string"],
    }],
    matchers=[{
        "field": "string",
        "type": "string",
        "value": "string",
    }],
    zone_id="string",
    enabled=False,
    name="string",
    priority=0)
Copy
const emailRoutingRuleResource = new cloudflare.EmailRoutingRule("emailRoutingRuleResource", {
    actions: [{
        type: "string",
        values: ["string"],
    }],
    matchers: [{
        field: "string",
        type: "string",
        value: "string",
    }],
    zoneId: "string",
    enabled: false,
    name: "string",
    priority: 0,
});
Copy
type: cloudflare:EmailRoutingRule
properties:
    actions:
        - type: string
          values:
            - string
    enabled: false
    matchers:
        - field: string
          type: string
          value: string
    name: string
    priority: 0
    zoneId: string
Copy

EmailRoutingRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The EmailRoutingRule resource accepts the following input properties:

Actions This property is required. List<EmailRoutingRuleAction>
List actions patterns.
Matchers This property is required. List<EmailRoutingRuleMatcher>
Matching patterns to forward to your actions.
ZoneId This property is required. string
Identifier
Enabled bool
Routing rule status.
Name string
Routing rule name.
Priority double
Priority of the routing rule.
Actions This property is required. []EmailRoutingRuleActionArgs
List actions patterns.
Matchers This property is required. []EmailRoutingRuleMatcherArgs
Matching patterns to forward to your actions.
ZoneId This property is required. string
Identifier
Enabled bool
Routing rule status.
Name string
Routing rule name.
Priority float64
Priority of the routing rule.
actions This property is required. List<EmailRoutingRuleAction>
List actions patterns.
matchers This property is required. List<EmailRoutingRuleMatcher>
Matching patterns to forward to your actions.
zoneId This property is required. String
Identifier
enabled Boolean
Routing rule status.
name String
Routing rule name.
priority Double
Priority of the routing rule.
actions This property is required. EmailRoutingRuleAction[]
List actions patterns.
matchers This property is required. EmailRoutingRuleMatcher[]
Matching patterns to forward to your actions.
zoneId This property is required. string
Identifier
enabled boolean
Routing rule status.
name string
Routing rule name.
priority number
Priority of the routing rule.
actions This property is required. Sequence[EmailRoutingRuleActionArgs]
List actions patterns.
matchers This property is required. Sequence[EmailRoutingRuleMatcherArgs]
Matching patterns to forward to your actions.
zone_id This property is required. str
Identifier
enabled bool
Routing rule status.
name str
Routing rule name.
priority float
Priority of the routing rule.
actions This property is required. List<Property Map>
List actions patterns.
matchers This property is required. List<Property Map>
Matching patterns to forward to your actions.
zoneId This property is required. String
Identifier
enabled Boolean
Routing rule status.
name String
Routing rule name.
priority Number
Priority of the routing rule.

Outputs

All input properties are implicitly available as output properties. Additionally, the EmailRoutingRule resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Tag string
Routing rule tag. (Deprecated, replaced by routing rule identifier)
Id string
The provider-assigned unique ID for this managed resource.
Tag string
Routing rule tag. (Deprecated, replaced by routing rule identifier)
id String
The provider-assigned unique ID for this managed resource.
tag String
Routing rule tag. (Deprecated, replaced by routing rule identifier)
id string
The provider-assigned unique ID for this managed resource.
tag string
Routing rule tag. (Deprecated, replaced by routing rule identifier)
id str
The provider-assigned unique ID for this managed resource.
tag str
Routing rule tag. (Deprecated, replaced by routing rule identifier)
id String
The provider-assigned unique ID for this managed resource.
tag String
Routing rule tag. (Deprecated, replaced by routing rule identifier)

Look up Existing EmailRoutingRule Resource

Get an existing EmailRoutingRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: EmailRoutingRuleState, opts?: CustomResourceOptions): EmailRoutingRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        actions: Optional[Sequence[EmailRoutingRuleActionArgs]] = None,
        enabled: Optional[bool] = None,
        matchers: Optional[Sequence[EmailRoutingRuleMatcherArgs]] = None,
        name: Optional[str] = None,
        priority: Optional[float] = None,
        tag: Optional[str] = None,
        zone_id: Optional[str] = None) -> EmailRoutingRule
func GetEmailRoutingRule(ctx *Context, name string, id IDInput, state *EmailRoutingRuleState, opts ...ResourceOption) (*EmailRoutingRule, error)
public static EmailRoutingRule Get(string name, Input<string> id, EmailRoutingRuleState? state, CustomResourceOptions? opts = null)
public static EmailRoutingRule get(String name, Output<String> id, EmailRoutingRuleState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:EmailRoutingRule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Actions List<EmailRoutingRuleAction>
List actions patterns.
Enabled bool
Routing rule status.
Matchers List<EmailRoutingRuleMatcher>
Matching patterns to forward to your actions.
Name string
Routing rule name.
Priority double
Priority of the routing rule.
Tag string
Routing rule tag. (Deprecated, replaced by routing rule identifier)
ZoneId string
Identifier
Actions []EmailRoutingRuleActionArgs
List actions patterns.
Enabled bool
Routing rule status.
Matchers []EmailRoutingRuleMatcherArgs
Matching patterns to forward to your actions.
Name string
Routing rule name.
Priority float64
Priority of the routing rule.
Tag string
Routing rule tag. (Deprecated, replaced by routing rule identifier)
ZoneId string
Identifier
actions List<EmailRoutingRuleAction>
List actions patterns.
enabled Boolean
Routing rule status.
matchers List<EmailRoutingRuleMatcher>
Matching patterns to forward to your actions.
name String
Routing rule name.
priority Double
Priority of the routing rule.
tag String
Routing rule tag. (Deprecated, replaced by routing rule identifier)
zoneId String
Identifier
actions EmailRoutingRuleAction[]
List actions patterns.
enabled boolean
Routing rule status.
matchers EmailRoutingRuleMatcher[]
Matching patterns to forward to your actions.
name string
Routing rule name.
priority number
Priority of the routing rule.
tag string
Routing rule tag. (Deprecated, replaced by routing rule identifier)
zoneId string
Identifier
actions Sequence[EmailRoutingRuleActionArgs]
List actions patterns.
enabled bool
Routing rule status.
matchers Sequence[EmailRoutingRuleMatcherArgs]
Matching patterns to forward to your actions.
name str
Routing rule name.
priority float
Priority of the routing rule.
tag str
Routing rule tag. (Deprecated, replaced by routing rule identifier)
zone_id str
Identifier
actions List<Property Map>
List actions patterns.
enabled Boolean
Routing rule status.
matchers List<Property Map>
Matching patterns to forward to your actions.
name String
Routing rule name.
priority Number
Priority of the routing rule.
tag String
Routing rule tag. (Deprecated, replaced by routing rule identifier)
zoneId String
Identifier

Supporting Types

EmailRoutingRuleAction
, EmailRoutingRuleActionArgs

Type This property is required. string
Type of supported action. Available values: "drop", "forward", "worker".
Values This property is required. List<string>
Type This property is required. string
Type of supported action. Available values: "drop", "forward", "worker".
Values This property is required. []string
type This property is required. String
Type of supported action. Available values: "drop", "forward", "worker".
values This property is required. List<String>
type This property is required. string
Type of supported action. Available values: "drop", "forward", "worker".
values This property is required. string[]
type This property is required. str
Type of supported action. Available values: "drop", "forward", "worker".
values This property is required. Sequence[str]
type This property is required. String
Type of supported action. Available values: "drop", "forward", "worker".
values This property is required. List<String>

EmailRoutingRuleMatcher
, EmailRoutingRuleMatcherArgs

Field This property is required. string
Field for type matcher. Available values: "to".
Type This property is required. string
Type of matcher. Available values: "literal".
Value This property is required. string
Value for matcher.
Field This property is required. string
Field for type matcher. Available values: "to".
Type This property is required. string
Type of matcher. Available values: "literal".
Value This property is required. string
Value for matcher.
field This property is required. String
Field for type matcher. Available values: "to".
type This property is required. String
Type of matcher. Available values: "literal".
value This property is required. String
Value for matcher.
field This property is required. string
Field for type matcher. Available values: "to".
type This property is required. string
Type of matcher. Available values: "literal".
value This property is required. string
Value for matcher.
field This property is required. str
Field for type matcher. Available values: "to".
type This property is required. str
Type of matcher. Available values: "literal".
value This property is required. str
Value for matcher.
field This property is required. String
Field for type matcher. Available values: "to".
type This property is required. String
Type of matcher. Available values: "literal".
value This property is required. String
Value for matcher.

Import

$ pulumi import cloudflare:index/emailRoutingRule:EmailRoutingRule example '<zone_id>/<rule_identifier>'
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.