1. Packages
  2. Routeros Provider
  3. API Docs
  4. RoutingRule
routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros

routeros.RoutingRule

Explore with Pulumi AI

routeros logo
routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as routeros from "@pulumi/routeros";
    
    const test = new routeros.RoutingRule("test", {
        action: "lookup-only-in-table",
        dstAddress: "192.168.1.0/24",
        "interface": "ether1",
    });
    
    import pulumi
    import pulumi_routeros as routeros
    
    test = routeros.RoutingRule("test",
        action="lookup-only-in-table",
        dst_address="192.168.1.0/24",
        interface="ether1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/routeros/routeros"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := routeros.NewRoutingRule(ctx, "test", &routeros.RoutingRuleArgs{
    			Action:     pulumi.String("lookup-only-in-table"),
    			DstAddress: pulumi.String("192.168.1.0/24"),
    			Interface:  pulumi.String("ether1"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Routeros = Pulumi.Routeros;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Routeros.RoutingRule("test", new()
        {
            Action = "lookup-only-in-table",
            DstAddress = "192.168.1.0/24",
            Interface = "ether1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.routeros.RoutingRule;
    import com.pulumi.routeros.RoutingRuleArgs;
    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 test = new RoutingRule("test", RoutingRuleArgs.builder()
                .action("lookup-only-in-table")
                .dstAddress("192.168.1.0/24")
                .interface_("ether1")
                .build());
    
        }
    }
    
    resources:
      test:
        type: routeros:RoutingRule
        properties:
          action: lookup-only-in-table
          dstAddress: 192.168.1.0/24
          interface: ether1
    

    Create RoutingRule Resource

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

    Constructor syntax

    new RoutingRule(name: string, args?: RoutingRuleArgs, opts?: CustomResourceOptions);
    @overload
    def RoutingRule(resource_name: str,
                    args: Optional[RoutingRuleArgs] = None,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def RoutingRule(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    ___id_: Optional[float] = None,
                    ___path_: Optional[str] = None,
                    action: Optional[str] = None,
                    comment: Optional[str] = None,
                    disabled: Optional[bool] = None,
                    dst_address: Optional[str] = None,
                    interface: Optional[str] = None,
                    min_prefix: Optional[float] = None,
                    routing_mark: Optional[str] = None,
                    routing_rule_id: Optional[str] = None,
                    src_address: Optional[str] = None,
                    table: Optional[str] = None)
    func NewRoutingRule(ctx *Context, name string, args *RoutingRuleArgs, opts ...ResourceOption) (*RoutingRule, error)
    public RoutingRule(string name, RoutingRuleArgs? args = null, CustomResourceOptions? opts = null)
    public RoutingRule(String name, RoutingRuleArgs args)
    public RoutingRule(String name, RoutingRuleArgs args, CustomResourceOptions options)
    
    type: routeros:RoutingRule
    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 RoutingRuleArgs
    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 RoutingRuleArgs
    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 RoutingRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RoutingRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RoutingRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    RoutingRule 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 RoutingRule resource accepts the following input properties:

    Action string
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    Comment string
    Disabled bool
    DstAddress string
    The destination address of the packet to match.
    Interface string
    Incoming interface to match.
    MinPrefix double
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    RoutingMark string
    Match specific routing mark.
    RoutingRuleId string
    SrcAddress string
    The source address of the packet to match.
    Table string
    Name of the routing table to use for lookup.
    ___id_ double
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    Action string
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    Comment string
    Disabled bool
    DstAddress string
    The destination address of the packet to match.
    Interface string
    Incoming interface to match.
    MinPrefix float64
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    RoutingMark string
    Match specific routing mark.
    RoutingRuleId string
    SrcAddress string
    The source address of the packet to match.
    Table string
    Name of the routing table to use for lookup.
    ___id_ float64
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    ___id_ Double
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ String
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    action String
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    comment String
    disabled Boolean
    dstAddress String
    The destination address of the packet to match.
    interface_ String
    Incoming interface to match.
    minPrefix Double
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    routingMark String
    Match specific routing mark.
    routingRuleId String
    srcAddress String
    The source address of the packet to match.
    table String
    Name of the routing table to use for lookup.
    ___id_ number
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    action string
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    comment string
    disabled boolean
    dstAddress string
    The destination address of the packet to match.
    interface string
    Incoming interface to match.
    minPrefix number
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    routingMark string
    Match specific routing mark.
    routingRuleId string
    srcAddress string
    The source address of the packet to match.
    table string
    Name of the routing table to use for lookup.
    ___id_ float
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ str
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    action str
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    comment str
    disabled bool
    dst_address str
    The destination address of the packet to match.
    interface str
    Incoming interface to match.
    min_prefix float
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    routing_mark str
    Match specific routing mark.
    routing_rule_id str
    src_address str
    The source address of the packet to match.
    table str
    Name of the routing table to use for lookup.
    ___id_ Number
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ String
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    action String
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    comment String
    disabled Boolean
    dstAddress String
    The destination address of the packet to match.
    interface String
    Incoming interface to match.
    minPrefix Number
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    routingMark String
    Match specific routing mark.
    routingRuleId String
    srcAddress String
    The source address of the packet to match.
    table String
    Name of the routing table to use for lookup.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Inactive bool
    Id string
    The provider-assigned unique ID for this managed resource.
    Inactive bool
    id String
    The provider-assigned unique ID for this managed resource.
    inactive Boolean
    id string
    The provider-assigned unique ID for this managed resource.
    inactive boolean
    id str
    The provider-assigned unique ID for this managed resource.
    inactive bool
    id String
    The provider-assigned unique ID for this managed resource.
    inactive Boolean

    Look up Existing RoutingRule Resource

    Get an existing RoutingRule 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?: RoutingRuleState, opts?: CustomResourceOptions): RoutingRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ___id_: Optional[float] = None,
            ___path_: Optional[str] = None,
            action: Optional[str] = None,
            comment: Optional[str] = None,
            disabled: Optional[bool] = None,
            dst_address: Optional[str] = None,
            inactive: Optional[bool] = None,
            interface: Optional[str] = None,
            min_prefix: Optional[float] = None,
            routing_mark: Optional[str] = None,
            routing_rule_id: Optional[str] = None,
            src_address: Optional[str] = None,
            table: Optional[str] = None) -> RoutingRule
    func GetRoutingRule(ctx *Context, name string, id IDInput, state *RoutingRuleState, opts ...ResourceOption) (*RoutingRule, error)
    public static RoutingRule Get(string name, Input<string> id, RoutingRuleState? state, CustomResourceOptions? opts = null)
    public static RoutingRule get(String name, Output<String> id, RoutingRuleState state, CustomResourceOptions options)
    resources:  _:    type: routeros:RoutingRule    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.
    The following state arguments are supported:
    Action string
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    Comment string
    Disabled bool
    DstAddress string
    The destination address of the packet to match.
    Inactive bool
    Interface string
    Incoming interface to match.
    MinPrefix double
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    RoutingMark string
    Match specific routing mark.
    RoutingRuleId string
    SrcAddress string
    The source address of the packet to match.
    Table string
    Name of the routing table to use for lookup.
    ___id_ double
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    Action string
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    Comment string
    Disabled bool
    DstAddress string
    The destination address of the packet to match.
    Inactive bool
    Interface string
    Incoming interface to match.
    MinPrefix float64
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    RoutingMark string
    Match specific routing mark.
    RoutingRuleId string
    SrcAddress string
    The source address of the packet to match.
    Table string
    Name of the routing table to use for lookup.
    ___id_ float64
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    ___id_ Double
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ String
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    action String
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    comment String
    disabled Boolean
    dstAddress String
    The destination address of the packet to match.
    inactive Boolean
    interface_ String
    Incoming interface to match.
    minPrefix Double
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    routingMark String
    Match specific routing mark.
    routingRuleId String
    srcAddress String
    The source address of the packet to match.
    table String
    Name of the routing table to use for lookup.
    ___id_ number
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    action string
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    comment string
    disabled boolean
    dstAddress string
    The destination address of the packet to match.
    inactive boolean
    interface string
    Incoming interface to match.
    minPrefix number
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    routingMark string
    Match specific routing mark.
    routingRuleId string
    srcAddress string
    The source address of the packet to match.
    table string
    Name of the routing table to use for lookup.
    ___id_ float
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ str
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    action str
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    comment str
    disabled bool
    dst_address str
    The destination address of the packet to match.
    inactive bool
    interface str
    Incoming interface to match.
    min_prefix float
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    routing_mark str
    Match specific routing mark.
    routing_rule_id str
    src_address str
    The source address of the packet to match.
    table str
    Name of the routing table to use for lookup.
    ___id_ Number
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ String
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    action String
    An action to take on the matching packet: * drop - silently drop the packet. * lookup - perform a lookup in routing tables. * lookup-only-in-table - perform lookup only in the specified routing table (see table parameter). * unreachable

    • generate ICMP unreachable message and send it back to the source.
    comment String
    disabled Boolean
    dstAddress String
    The destination address of the packet to match.
    inactive Boolean
    interface String
    Incoming interface to match.
    minPrefix Number
    Equivalent to Linux IP rule suppress_prefixlength. For example to suppress the default route in the routing decision set the value to 0.
    routingMark String
    Match specific routing mark.
    routingRuleId String
    srcAddress String
    The source address of the packet to match.
    table String
    Name of the routing table to use for lookup.

    Import

    #The ID can be found via API or the terminal

    #The command for the terminal is -> :put [/routing/rule get [print show-ids]]

    $ pulumi import routeros:index/routingRule:RoutingRule test *3
    

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

    Package Details

    Repository
    routeros terraform-routeros/terraform-provider-routeros
    License
    Notes
    This Pulumi package is based on the routeros Terraform Provider.
    routeros logo
    routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros