zenduty.GlobalroutingRule
Explore with Pulumi AI
An Global Router allows users to create routing rules. The Router evaluates events sent to this Router against each of its rules, one at a time, and routes the event to a specific Integration based on the first rule that matches.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as zenduty from "@pulumi/zenduty";
const router = new zenduty.Globalrouter("router", {description: "This is a demo router"});
const demorules = new zenduty.GlobalroutingRule("demorules", {
    routerId: router.globalrouterId,
    ruleJson: "",
    actions: [{
        actionType: 0,
        integration: "unique_id of integration",
    }],
});
const supressrule = new zenduty.GlobalroutingRule("supressrule", {
    routerId: router.globalrouterId,
    ruleJson: "",
    actions: [{
        actionType: 1,
    }],
});
import pulumi
import pulumi_zenduty as zenduty
router = zenduty.Globalrouter("router", description="This is a demo router")
demorules = zenduty.GlobalroutingRule("demorules",
    router_id=router.globalrouter_id,
    rule_json="",
    actions=[{
        "action_type": 0,
        "integration": "unique_id of integration",
    }])
supressrule = zenduty.GlobalroutingRule("supressrule",
    router_id=router.globalrouter_id,
    rule_json="",
    actions=[{
        "action_type": 1,
    }])
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/zenduty/zenduty"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		router, err := zenduty.NewGlobalrouter(ctx, "router", &zenduty.GlobalrouterArgs{
			Description: pulumi.String("This is a demo router"),
		})
		if err != nil {
			return err
		}
		_, err = zenduty.NewGlobalroutingRule(ctx, "demorules", &zenduty.GlobalroutingRuleArgs{
			RouterId: router.GlobalrouterId,
			RuleJson: pulumi.String(""),
			Actions: zenduty.GlobalroutingRuleActionArray{
				&zenduty.GlobalroutingRuleActionArgs{
					ActionType:  pulumi.Float64(0),
					Integration: pulumi.String("unique_id of integration"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = zenduty.NewGlobalroutingRule(ctx, "supressrule", &zenduty.GlobalroutingRuleArgs{
			RouterId: router.GlobalrouterId,
			RuleJson: pulumi.String(""),
			Actions: zenduty.GlobalroutingRuleActionArray{
				&zenduty.GlobalroutingRuleActionArgs{
					ActionType: pulumi.Float64(1),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Zenduty = Pulumi.Zenduty;
return await Deployment.RunAsync(() => 
{
    var router = new Zenduty.Globalrouter("router", new()
    {
        Description = "This is a demo router",
    });
    var demorules = new Zenduty.GlobalroutingRule("demorules", new()
    {
        RouterId = router.GlobalrouterId,
        RuleJson = "",
        Actions = new[]
        {
            new Zenduty.Inputs.GlobalroutingRuleActionArgs
            {
                ActionType = 0,
                Integration = "unique_id of integration",
            },
        },
    });
    var supressrule = new Zenduty.GlobalroutingRule("supressrule", new()
    {
        RouterId = router.GlobalrouterId,
        RuleJson = "",
        Actions = new[]
        {
            new Zenduty.Inputs.GlobalroutingRuleActionArgs
            {
                ActionType = 1,
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zenduty.Globalrouter;
import com.pulumi.zenduty.GlobalrouterArgs;
import com.pulumi.zenduty.GlobalroutingRule;
import com.pulumi.zenduty.GlobalroutingRuleArgs;
import com.pulumi.zenduty.inputs.GlobalroutingRuleActionArgs;
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) {
        var router = new Globalrouter("router", GlobalrouterArgs.builder()
            .description("This is a demo router")
            .build());
        var demorules = new GlobalroutingRule("demorules", GlobalroutingRuleArgs.builder()
            .routerId(router.globalrouterId())
            .ruleJson("")
            .actions(GlobalroutingRuleActionArgs.builder()
                .actionType(0)
                .integration("unique_id of integration")
                .build())
            .build());
        var supressrule = new GlobalroutingRule("supressrule", GlobalroutingRuleArgs.builder()
            .routerId(router.globalrouterId())
            .ruleJson("")
            .actions(GlobalroutingRuleActionArgs.builder()
                .actionType(1)
                .build())
            .build());
    }
}
resources:
  router:
    type: zenduty:Globalrouter
    properties:
      description: This is a demo router
  demorules:
    type: zenduty:GlobalroutingRule
    properties:
      routerId: ${router.globalrouterId}
      ruleJson: ""
      actions:
        - actionType: 0
          integration: unique_id of integration
  supressrule:
    type: zenduty:GlobalroutingRule
    properties:
      routerId: ${router.globalrouterId}
      ruleJson: ""
      actions:
        - actionType: 1
Create GlobalroutingRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GlobalroutingRule(name: string, args: GlobalroutingRuleArgs, opts?: CustomResourceOptions);@overload
def GlobalroutingRule(resource_name: str,
                      args: GlobalroutingRuleArgs,
                      opts: Optional[ResourceOptions] = None)
@overload
def GlobalroutingRule(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      router_id: Optional[str] = None,
                      actions: Optional[Sequence[GlobalroutingRuleActionArgs]] = None,
                      globalrouting_rule_id: Optional[str] = None,
                      name: Optional[str] = None,
                      rule_json: Optional[str] = None)func NewGlobalroutingRule(ctx *Context, name string, args GlobalroutingRuleArgs, opts ...ResourceOption) (*GlobalroutingRule, error)public GlobalroutingRule(string name, GlobalroutingRuleArgs args, CustomResourceOptions? opts = null)
public GlobalroutingRule(String name, GlobalroutingRuleArgs args)
public GlobalroutingRule(String name, GlobalroutingRuleArgs args, CustomResourceOptions options)
type: zenduty:GlobalroutingRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args GlobalroutingRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args GlobalroutingRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args GlobalroutingRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GlobalroutingRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GlobalroutingRuleArgs
- 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 globalroutingRuleResource = new Zenduty.GlobalroutingRule("globalroutingRuleResource", new()
{
    RouterId = "string",
    Actions = new[]
    {
        new Zenduty.Inputs.GlobalroutingRuleActionArgs
        {
            ActionType = 0,
            Integration = "string",
        },
    },
    GlobalroutingRuleId = "string",
    Name = "string",
    RuleJson = "string",
});
example, err := zenduty.NewGlobalroutingRule(ctx, "globalroutingRuleResource", &zenduty.GlobalroutingRuleArgs{
RouterId: pulumi.String("string"),
Actions: .GlobalroutingRuleActionArray{
&.GlobalroutingRuleActionArgs{
ActionType: pulumi.Float64(0),
Integration: pulumi.String("string"),
},
},
GlobalroutingRuleId: pulumi.String("string"),
Name: pulumi.String("string"),
RuleJson: pulumi.String("string"),
})
var globalroutingRuleResource = new GlobalroutingRule("globalroutingRuleResource", GlobalroutingRuleArgs.builder()
    .routerId("string")
    .actions(GlobalroutingRuleActionArgs.builder()
        .actionType(0)
        .integration("string")
        .build())
    .globalroutingRuleId("string")
    .name("string")
    .ruleJson("string")
    .build());
globalrouting_rule_resource = zenduty.GlobalroutingRule("globalroutingRuleResource",
    router_id="string",
    actions=[{
        "action_type": 0,
        "integration": "string",
    }],
    globalrouting_rule_id="string",
    name="string",
    rule_json="string")
const globalroutingRuleResource = new zenduty.GlobalroutingRule("globalroutingRuleResource", {
    routerId: "string",
    actions: [{
        actionType: 0,
        integration: "string",
    }],
    globalroutingRuleId: "string",
    name: "string",
    ruleJson: "string",
});
type: zenduty:GlobalroutingRule
properties:
    actions:
        - actionType: 0
          integration: string
    globalroutingRuleId: string
    name: string
    routerId: string
    ruleJson: string
GlobalroutingRule 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 GlobalroutingRule resource accepts the following input properties:
- RouterId string
- UniqueID of the GlobalRouter
- Actions
List<GlobalroutingRule Action> 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- GlobalroutingRule stringId 
- The ID of the GlobalRouterRule.
- Name string
- Name of the Routing Rule
- RuleJson string
- RouterId string
- UniqueID of the GlobalRouter
- Actions
[]GlobalroutingRule Action Args 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- GlobalroutingRule stringId 
- The ID of the GlobalRouterRule.
- Name string
- Name of the Routing Rule
- RuleJson string
- routerId String
- UniqueID of the GlobalRouter
- actions
List<GlobalroutingRule Action> 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- globalroutingRule StringId 
- The ID of the GlobalRouterRule.
- name String
- Name of the Routing Rule
- ruleJson String
- routerId string
- UniqueID of the GlobalRouter
- actions
GlobalroutingRule Action[] 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- globalroutingRule stringId 
- The ID of the GlobalRouterRule.
- name string
- Name of the Routing Rule
- ruleJson string
- router_id str
- UniqueID of the GlobalRouter
- actions
Sequence[GlobalroutingRule Action Args] 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- globalrouting_rule_ strid 
- The ID of the GlobalRouterRule.
- name str
- Name of the Routing Rule
- rule_json str
- routerId String
- UniqueID of the GlobalRouter
- actions List<Property Map>
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- globalroutingRule StringId 
- The ID of the GlobalRouterRule.
- name String
- Name of the Routing Rule
- ruleJson String
Outputs
All input properties are implicitly available as output properties. Additionally, the GlobalroutingRule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing GlobalroutingRule Resource
Get an existing GlobalroutingRule 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?: GlobalroutingRuleState, opts?: CustomResourceOptions): GlobalroutingRule@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        actions: Optional[Sequence[GlobalroutingRuleActionArgs]] = None,
        globalrouting_rule_id: Optional[str] = None,
        name: Optional[str] = None,
        router_id: Optional[str] = None,
        rule_json: Optional[str] = None) -> GlobalroutingRulefunc GetGlobalroutingRule(ctx *Context, name string, id IDInput, state *GlobalroutingRuleState, opts ...ResourceOption) (*GlobalroutingRule, error)public static GlobalroutingRule Get(string name, Input<string> id, GlobalroutingRuleState? state, CustomResourceOptions? opts = null)public static GlobalroutingRule get(String name, Output<String> id, GlobalroutingRuleState state, CustomResourceOptions options)resources:  _:    type: zenduty:GlobalroutingRule    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Actions
List<GlobalroutingRule Action> 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- GlobalroutingRule stringId 
- The ID of the GlobalRouterRule.
- Name string
- Name of the Routing Rule
- RouterId string
- UniqueID of the GlobalRouter
- RuleJson string
- Actions
[]GlobalroutingRule Action Args 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- GlobalroutingRule stringId 
- The ID of the GlobalRouterRule.
- Name string
- Name of the Routing Rule
- RouterId string
- UniqueID of the GlobalRouter
- RuleJson string
- actions
List<GlobalroutingRule Action> 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- globalroutingRule StringId 
- The ID of the GlobalRouterRule.
- name String
- Name of the Routing Rule
- routerId String
- UniqueID of the GlobalRouter
- ruleJson String
- actions
GlobalroutingRule Action[] 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- globalroutingRule stringId 
- The ID of the GlobalRouterRule.
- name string
- Name of the Routing Rule
- routerId string
- UniqueID of the GlobalRouter
- ruleJson string
- actions
Sequence[GlobalroutingRule Action Args] 
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- globalrouting_rule_ strid 
- The ID of the GlobalRouterRule.
- name str
- Name of the Routing Rule
- router_id str
- UniqueID of the GlobalRouter
- rule_json str
- actions List<Property Map>
- The actions to be performed when the rule matches.values are 0route to integration1supress the alert
- globalroutingRule StringId 
- The ID of the GlobalRouterRule.
- name String
- Name of the Routing Rule
- routerId String
- UniqueID of the GlobalRouter
- ruleJson String
Supporting Types
GlobalroutingRuleAction, GlobalroutingRuleActionArgs      
- ActionType double
- Integration string
- ActionType float64
- Integration string
- actionType Double
- integration String
- actionType number
- integration string
- action_type float
- integration str
- actionType Number
- integration String
Import
GlobalRouterRule can be imported using the router_id/rule_id(ie. UniqueID of the router,rule), e.g.
hcl
resource “zenduty_globalrouting_rule” “rule1” {
}
$ pulumi import zenduty:index/globalroutingRule:GlobalroutingRule rule1 router_id/rule_id`
$ terraform state show zenduty_globalrouting_rule.rule1
copy the output data and paste inside zenduty_globalrouting_rule.rule1 resource block and remove the id attribute
$ pulumi preview to verify the import
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- zenduty zenduty/terraform-provider-zenduty
- License
- Notes
- This Pulumi package is based on the zendutyTerraform Provider.