1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getEmailRoutingRule
Cloudflare v6.0.0 published on Monday, Apr 14, 2025 by Pulumi

cloudflare.getEmailRoutingRule

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const exampleEmailRoutingRule = cloudflare.getEmailRoutingRule({
    zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
    ruleIdentifier: "a7e6fb77503c41d8a7f3113c6918f10c",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_email_routing_rule = cloudflare.get_email_routing_rule(zone_id="023e105f4ecef8ad9ca31a8372d0c353",
    rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c")
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.LookupEmailRoutingRule(ctx, &cloudflare.LookupEmailRoutingRuleArgs{
			ZoneId:         "023e105f4ecef8ad9ca31a8372d0c353",
			RuleIdentifier: pulumi.StringRef("a7e6fb77503c41d8a7f3113c6918f10c"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var exampleEmailRoutingRule = Cloudflare.GetEmailRoutingRule.Invoke(new()
    {
        ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
        RuleIdentifier = "a7e6fb77503c41d8a7f3113c6918f10c",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.CloudflareFunctions;
import com.pulumi.cloudflare.inputs.GetEmailRoutingRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var exampleEmailRoutingRule = CloudflareFunctions.getEmailRoutingRule(GetEmailRoutingRuleArgs.builder()
            .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
            .ruleIdentifier("a7e6fb77503c41d8a7f3113c6918f10c")
            .build());

    }
}
Copy
variables:
  exampleEmailRoutingRule:
    fn::invoke:
      function: cloudflare:getEmailRoutingRule
      arguments:
        zoneId: 023e105f4ecef8ad9ca31a8372d0c353
        ruleIdentifier: a7e6fb77503c41d8a7f3113c6918f10c
Copy

Using getEmailRoutingRule

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getEmailRoutingRule(args: GetEmailRoutingRuleArgs, opts?: InvokeOptions): Promise<GetEmailRoutingRuleResult>
function getEmailRoutingRuleOutput(args: GetEmailRoutingRuleOutputArgs, opts?: InvokeOptions): Output<GetEmailRoutingRuleResult>
Copy
def get_email_routing_rule(filter: Optional[GetEmailRoutingRuleFilter] = None,
                           rule_identifier: Optional[str] = None,
                           zone_id: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetEmailRoutingRuleResult
def get_email_routing_rule_output(filter: Optional[pulumi.Input[GetEmailRoutingRuleFilterArgs]] = None,
                           rule_identifier: Optional[pulumi.Input[str]] = None,
                           zone_id: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetEmailRoutingRuleResult]
Copy
func LookupEmailRoutingRule(ctx *Context, args *LookupEmailRoutingRuleArgs, opts ...InvokeOption) (*LookupEmailRoutingRuleResult, error)
func LookupEmailRoutingRuleOutput(ctx *Context, args *LookupEmailRoutingRuleOutputArgs, opts ...InvokeOption) LookupEmailRoutingRuleResultOutput
Copy

> Note: This function is named LookupEmailRoutingRule in the Go SDK.

public static class GetEmailRoutingRule 
{
    public static Task<GetEmailRoutingRuleResult> InvokeAsync(GetEmailRoutingRuleArgs args, InvokeOptions? opts = null)
    public static Output<GetEmailRoutingRuleResult> Invoke(GetEmailRoutingRuleInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetEmailRoutingRuleResult> getEmailRoutingRule(GetEmailRoutingRuleArgs args, InvokeOptions options)
public static Output<GetEmailRoutingRuleResult> getEmailRoutingRule(GetEmailRoutingRuleArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: cloudflare:index/getEmailRoutingRule:getEmailRoutingRule
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ZoneId This property is required. string
Identifier
Filter GetEmailRoutingRuleFilter
RuleIdentifier string
Routing rule identifier.
ZoneId This property is required. string
Identifier
Filter GetEmailRoutingRuleFilter
RuleIdentifier string
Routing rule identifier.
zoneId This property is required. String
Identifier
filter GetEmailRoutingRuleFilter
ruleIdentifier String
Routing rule identifier.
zoneId This property is required. string
Identifier
filter GetEmailRoutingRuleFilter
ruleIdentifier string
Routing rule identifier.
zone_id This property is required. str
Identifier
filter GetEmailRoutingRuleFilter
rule_identifier str
Routing rule identifier.
zoneId This property is required. String
Identifier
filter Property Map
ruleIdentifier String
Routing rule identifier.

getEmailRoutingRule Result

The following output properties are available:

Actions List<GetEmailRoutingRuleAction>
List actions patterns.
Enabled bool
Routing rule status.
Id string
Routing rule identifier.
Matchers List<GetEmailRoutingRuleMatcher>
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
Filter GetEmailRoutingRuleFilter
RuleIdentifier string
Routing rule identifier.
Actions []GetEmailRoutingRuleAction
List actions patterns.
Enabled bool
Routing rule status.
Id string
Routing rule identifier.
Matchers []GetEmailRoutingRuleMatcher
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
Filter GetEmailRoutingRuleFilter
RuleIdentifier string
Routing rule identifier.
actions List<GetEmailRoutingRuleAction>
List actions patterns.
enabled Boolean
Routing rule status.
id String
Routing rule identifier.
matchers List<GetEmailRoutingRuleMatcher>
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
filter GetEmailRoutingRuleFilter
ruleIdentifier String
Routing rule identifier.
actions GetEmailRoutingRuleAction[]
List actions patterns.
enabled boolean
Routing rule status.
id string
Routing rule identifier.
matchers GetEmailRoutingRuleMatcher[]
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
filter GetEmailRoutingRuleFilter
ruleIdentifier string
Routing rule identifier.
actions Sequence[GetEmailRoutingRuleAction]
List actions patterns.
enabled bool
Routing rule status.
id str
Routing rule identifier.
matchers Sequence[GetEmailRoutingRuleMatcher]
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
filter GetEmailRoutingRuleFilter
rule_identifier str
Routing rule identifier.
actions List<Property Map>
List actions patterns.
enabled Boolean
Routing rule status.
id String
Routing rule identifier.
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
filter Property Map
ruleIdentifier String
Routing rule identifier.

Supporting Types

GetEmailRoutingRuleAction

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>

GetEmailRoutingRuleFilter

Enabled bool
Filter by enabled routing rules.
Enabled bool
Filter by enabled routing rules.
enabled Boolean
Filter by enabled routing rules.
enabled boolean
Filter by enabled routing rules.
enabled bool
Filter by enabled routing rules.
enabled Boolean
Filter by enabled routing rules.

GetEmailRoutingRuleMatcher

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.

Package Details

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