1. Packages
  2. Routeros Provider
  3. API Docs
  4. InterfaceEthernetSwitchRule
routeros 1.83.0 published on Wednesday, Apr 16, 2025 by terraform-routeros

routeros.InterfaceEthernetSwitchRule

Explore with Pulumi AI

Example Usage

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

const test = new routeros.InterfaceEthernetSwitchRule("test", {
    copyToCpu: true,
    ports: ["ether1"],
    "switch": "switch1",
});
Copy
import pulumi
import pulumi_routeros as routeros

test = routeros.InterfaceEthernetSwitchRule("test",
    copy_to_cpu=True,
    ports=["ether1"],
    switch="switch1")
Copy
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.NewInterfaceEthernetSwitchRule(ctx, "test", &routeros.InterfaceEthernetSwitchRuleArgs{
			CopyToCpu: pulumi.Bool(true),
			Ports: pulumi.StringArray{
				pulumi.String("ether1"),
			},
			Switch: pulumi.String("switch1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Routeros = Pulumi.Routeros;

return await Deployment.RunAsync(() => 
{
    var test = new Routeros.InterfaceEthernetSwitchRule("test", new()
    {
        CopyToCpu = true,
        Ports = new[]
        {
            "ether1",
        },
        Switch = "switch1",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.routeros.InterfaceEthernetSwitchRule;
import com.pulumi.routeros.InterfaceEthernetSwitchRuleArgs;
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 InterfaceEthernetSwitchRule("test", InterfaceEthernetSwitchRuleArgs.builder()
            .copyToCpu(true)
            .ports("ether1")
            .switch_("switch1")
            .build());

    }
}
Copy
resources:
  test:
    type: routeros:InterfaceEthernetSwitchRule
    properties:
      copyToCpu: true
      ports:
        - ether1
      switch: switch1
Copy

Create InterfaceEthernetSwitchRule Resource

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

Constructor syntax

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

@overload
def InterfaceEthernetSwitchRule(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                ports: Optional[Sequence[str]] = None,
                                switch: Optional[str] = None,
                                mirror_ports: Optional[Sequence[str]] = None,
                                redirect_to_cpu: Optional[bool] = None,
                                disabled: Optional[bool] = None,
                                dscp: Optional[float] = None,
                                dst_address: Optional[str] = None,
                                dst_address6: Optional[str] = None,
                                dst_mac_address: Optional[str] = None,
                                dst_port: Optional[float] = None,
                                flow_label: Optional[float] = None,
                                interface_ethernet_switch_rule_id: Optional[str] = None,
                                mac_protocol: Optional[str] = None,
                                mirror: Optional[bool] = None,
                                ___id_: Optional[float] = None,
                                new_dst_ports: Optional[Sequence[str]] = None,
                                copy_to_cpu: Optional[bool] = None,
                                comment: Optional[str] = None,
                                new_vlan_id: Optional[float] = None,
                                protocol: Optional[str] = None,
                                rate: Optional[float] = None,
                                new_vlan_priority: Optional[float] = None,
                                src_address: Optional[str] = None,
                                src_address6: Optional[str] = None,
                                src_mac_address: Optional[str] = None,
                                src_port: Optional[float] = None,
                                ___path_: Optional[str] = None,
                                traffic_class: Optional[float] = None,
                                vlan_header: Optional[str] = None,
                                vlan_id: Optional[float] = None,
                                vlan_priority: Optional[float] = None)
func NewInterfaceEthernetSwitchRule(ctx *Context, name string, args InterfaceEthernetSwitchRuleArgs, opts ...ResourceOption) (*InterfaceEthernetSwitchRule, error)
public InterfaceEthernetSwitchRule(string name, InterfaceEthernetSwitchRuleArgs args, CustomResourceOptions? opts = null)
public InterfaceEthernetSwitchRule(String name, InterfaceEthernetSwitchRuleArgs args)
public InterfaceEthernetSwitchRule(String name, InterfaceEthernetSwitchRuleArgs args, CustomResourceOptions options)
type: routeros:InterfaceEthernetSwitchRule
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. InterfaceEthernetSwitchRuleArgs
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. InterfaceEthernetSwitchRuleArgs
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. InterfaceEthernetSwitchRuleArgs
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. InterfaceEthernetSwitchRuleArgs
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. InterfaceEthernetSwitchRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

Ports This property is required. List<string>
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
Switch This property is required. string
Matching switch group on which will the rule apply.
Comment string
CopyToCpu bool
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
Disabled bool
Dscp double
Matching DSCP field of the packet.
DstAddress string
Matching destination IP address and mask.
DstAddress6 string
Matching destination IPv6 address and mask.
DstMacAddress string
Matching destination MAC address and mask.
DstPort double
Matching destination protocol port number or range.
FlowLabel double
Matching IPv6 flow label.
InterfaceEthernetSwitchRuleId string
The ID of this resource.
MacProtocol string
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
Mirror bool
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
MirrorPorts List<string>
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
NewDstPorts List<string>
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
NewVlanId double
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
NewVlanPriority double
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
Protocol string
Matching particular IP protocol specified by protocol name or number.
Rate double
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
RedirectToCpu bool
Changes the destination port of a matching packet to the switch CPU.
SrcAddress string
Matching source IP address and mask.
SrcAddress6 string
Matching source IPv6 address and mask.
SrcMacAddress string
Matching source MAC address and mask.
SrcPort double
Matching source protocol port number or range.
TrafficClass double
Matching IPv6 traffic class.
VlanHeader string
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
VlanId double
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
VlanPriority double
Matching VLAN priority (priority code point).
___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.
Ports This property is required. []string
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
Switch This property is required. string
Matching switch group on which will the rule apply.
Comment string
CopyToCpu bool
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
Disabled bool
Dscp float64
Matching DSCP field of the packet.
DstAddress string
Matching destination IP address and mask.
DstAddress6 string
Matching destination IPv6 address and mask.
DstMacAddress string
Matching destination MAC address and mask.
DstPort float64
Matching destination protocol port number or range.
FlowLabel float64
Matching IPv6 flow label.
InterfaceEthernetSwitchRuleId string
The ID of this resource.
MacProtocol string
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
Mirror bool
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
MirrorPorts []string
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
NewDstPorts []string
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
NewVlanId float64
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
NewVlanPriority float64
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
Protocol string
Matching particular IP protocol specified by protocol name or number.
Rate float64
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
RedirectToCpu bool
Changes the destination port of a matching packet to the switch CPU.
SrcAddress string
Matching source IP address and mask.
SrcAddress6 string
Matching source IPv6 address and mask.
SrcMacAddress string
Matching source MAC address and mask.
SrcPort float64
Matching source protocol port number or range.
TrafficClass float64
Matching IPv6 traffic class.
VlanHeader string
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
VlanId float64
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
VlanPriority float64
Matching VLAN priority (priority code point).
___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.
ports This property is required. List<String>
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
switch_ This property is required. String
Matching switch group on which will the rule apply.
___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.
comment String
copyToCpu Boolean
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
disabled Boolean
dscp Double
Matching DSCP field of the packet.
dstAddress String
Matching destination IP address and mask.
dstAddress6 String
Matching destination IPv6 address and mask.
dstMacAddress String
Matching destination MAC address and mask.
dstPort Double
Matching destination protocol port number or range.
flowLabel Double
Matching IPv6 flow label.
interfaceEthernetSwitchRuleId String
The ID of this resource.
macProtocol String
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
mirror Boolean
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
mirrorPorts List<String>
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
newDstPorts List<String>
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
newVlanId Double
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
newVlanPriority Double
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
protocol String
Matching particular IP protocol specified by protocol name or number.
rate Double
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
redirectToCpu Boolean
Changes the destination port of a matching packet to the switch CPU.
srcAddress String
Matching source IP address and mask.
srcAddress6 String
Matching source IPv6 address and mask.
srcMacAddress String
Matching source MAC address and mask.
srcPort Double
Matching source protocol port number or range.
trafficClass Double
Matching IPv6 traffic class.
vlanHeader String
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanId Double
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanPriority Double
Matching VLAN priority (priority code point).
ports This property is required. string[]
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
switch This property is required. string
Matching switch group on which will the rule apply.
___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.
comment string
copyToCpu boolean
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
disabled boolean
dscp number
Matching DSCP field of the packet.
dstAddress string
Matching destination IP address and mask.
dstAddress6 string
Matching destination IPv6 address and mask.
dstMacAddress string
Matching destination MAC address and mask.
dstPort number
Matching destination protocol port number or range.
flowLabel number
Matching IPv6 flow label.
interfaceEthernetSwitchRuleId string
The ID of this resource.
macProtocol string
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
mirror boolean
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
mirrorPorts string[]
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
newDstPorts string[]
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
newVlanId number
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
newVlanPriority number
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
protocol string
Matching particular IP protocol specified by protocol name or number.
rate number
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
redirectToCpu boolean
Changes the destination port of a matching packet to the switch CPU.
srcAddress string
Matching source IP address and mask.
srcAddress6 string
Matching source IPv6 address and mask.
srcMacAddress string
Matching source MAC address and mask.
srcPort number
Matching source protocol port number or range.
trafficClass number
Matching IPv6 traffic class.
vlanHeader string
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanId number
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanPriority number
Matching VLAN priority (priority code point).
ports This property is required. Sequence[str]
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
switch This property is required. str
Matching switch group on which will the rule apply.
___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.
comment str
copy_to_cpu bool
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
disabled bool
dscp float
Matching DSCP field of the packet.
dst_address str
Matching destination IP address and mask.
dst_address6 str
Matching destination IPv6 address and mask.
dst_mac_address str
Matching destination MAC address and mask.
dst_port float
Matching destination protocol port number or range.
flow_label float
Matching IPv6 flow label.
interface_ethernet_switch_rule_id str
The ID of this resource.
mac_protocol str
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
mirror bool
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
mirror_ports Sequence[str]
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
new_dst_ports Sequence[str]
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
new_vlan_id float
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
new_vlan_priority float
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
protocol str
Matching particular IP protocol specified by protocol name or number.
rate float
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
redirect_to_cpu bool
Changes the destination port of a matching packet to the switch CPU.
src_address str
Matching source IP address and mask.
src_address6 str
Matching source IPv6 address and mask.
src_mac_address str
Matching source MAC address and mask.
src_port float
Matching source protocol port number or range.
traffic_class float
Matching IPv6 traffic class.
vlan_header str
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlan_id float
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlan_priority float
Matching VLAN priority (priority code point).
ports This property is required. List<String>
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
switch This property is required. String
Matching switch group on which will the rule apply.
___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.
comment String
copyToCpu Boolean
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
disabled Boolean
dscp Number
Matching DSCP field of the packet.
dstAddress String
Matching destination IP address and mask.
dstAddress6 String
Matching destination IPv6 address and mask.
dstMacAddress String
Matching destination MAC address and mask.
dstPort Number
Matching destination protocol port number or range.
flowLabel Number
Matching IPv6 flow label.
interfaceEthernetSwitchRuleId String
The ID of this resource.
macProtocol String
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
mirror Boolean
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
mirrorPorts List<String>
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
newDstPorts List<String>
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
newVlanId Number
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
newVlanPriority Number
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
protocol String
Matching particular IP protocol specified by protocol name or number.
rate Number
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
redirectToCpu Boolean
Changes the destination port of a matching packet to the switch CPU.
srcAddress String
Matching source IP address and mask.
srcAddress6 String
Matching source IPv6 address and mask.
srcMacAddress String
Matching source MAC address and mask.
srcPort Number
Matching source protocol port number or range.
trafficClass Number
Matching IPv6 traffic class.
vlanHeader String
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanId Number
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanPriority Number
Matching VLAN priority (priority code point).

Outputs

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

Dynamic bool
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
Id string
The provider-assigned unique ID for this managed resource.
Invalid bool
Dynamic bool
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
Id string
The provider-assigned unique ID for this managed resource.
Invalid bool
dynamic Boolean
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
id String
The provider-assigned unique ID for this managed resource.
invalid Boolean
dynamic boolean
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
id string
The provider-assigned unique ID for this managed resource.
invalid boolean
dynamic bool
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
id str
The provider-assigned unique ID for this managed resource.
invalid bool
dynamic Boolean
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
id String
The provider-assigned unique ID for this managed resource.
invalid Boolean

Look up Existing InterfaceEthernetSwitchRule Resource

Get an existing InterfaceEthernetSwitchRule 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?: InterfaceEthernetSwitchRuleState, opts?: CustomResourceOptions): InterfaceEthernetSwitchRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        ___id_: Optional[float] = None,
        ___path_: Optional[str] = None,
        comment: Optional[str] = None,
        copy_to_cpu: Optional[bool] = None,
        disabled: Optional[bool] = None,
        dscp: Optional[float] = None,
        dst_address: Optional[str] = None,
        dst_address6: Optional[str] = None,
        dst_mac_address: Optional[str] = None,
        dst_port: Optional[float] = None,
        dynamic: Optional[bool] = None,
        flow_label: Optional[float] = None,
        interface_ethernet_switch_rule_id: Optional[str] = None,
        invalid: Optional[bool] = None,
        mac_protocol: Optional[str] = None,
        mirror: Optional[bool] = None,
        mirror_ports: Optional[Sequence[str]] = None,
        new_dst_ports: Optional[Sequence[str]] = None,
        new_vlan_id: Optional[float] = None,
        new_vlan_priority: Optional[float] = None,
        ports: Optional[Sequence[str]] = None,
        protocol: Optional[str] = None,
        rate: Optional[float] = None,
        redirect_to_cpu: Optional[bool] = None,
        src_address: Optional[str] = None,
        src_address6: Optional[str] = None,
        src_mac_address: Optional[str] = None,
        src_port: Optional[float] = None,
        switch: Optional[str] = None,
        traffic_class: Optional[float] = None,
        vlan_header: Optional[str] = None,
        vlan_id: Optional[float] = None,
        vlan_priority: Optional[float] = None) -> InterfaceEthernetSwitchRule
func GetInterfaceEthernetSwitchRule(ctx *Context, name string, id IDInput, state *InterfaceEthernetSwitchRuleState, opts ...ResourceOption) (*InterfaceEthernetSwitchRule, error)
public static InterfaceEthernetSwitchRule Get(string name, Input<string> id, InterfaceEthernetSwitchRuleState? state, CustomResourceOptions? opts = null)
public static InterfaceEthernetSwitchRule get(String name, Output<String> id, InterfaceEthernetSwitchRuleState state, CustomResourceOptions options)
resources:  _:    type: routeros:InterfaceEthernetSwitchRule    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:
Comment string
CopyToCpu bool
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
Disabled bool
Dscp double
Matching DSCP field of the packet.
DstAddress string
Matching destination IP address and mask.
DstAddress6 string
Matching destination IPv6 address and mask.
DstMacAddress string
Matching destination MAC address and mask.
DstPort double
Matching destination protocol port number or range.
Dynamic bool
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
FlowLabel double
Matching IPv6 flow label.
InterfaceEthernetSwitchRuleId string
The ID of this resource.
Invalid bool
MacProtocol string
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
Mirror bool
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
MirrorPorts List<string>
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
NewDstPorts List<string>
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
NewVlanId double
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
NewVlanPriority double
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
Ports List<string>
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
Protocol string
Matching particular IP protocol specified by protocol name or number.
Rate double
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
RedirectToCpu bool
Changes the destination port of a matching packet to the switch CPU.
SrcAddress string
Matching source IP address and mask.
SrcAddress6 string
Matching source IPv6 address and mask.
SrcMacAddress string
Matching source MAC address and mask.
SrcPort double
Matching source protocol port number or range.
Switch string
Matching switch group on which will the rule apply.
TrafficClass double
Matching IPv6 traffic class.
VlanHeader string
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
VlanId double
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
VlanPriority double
Matching VLAN priority (priority code point).
___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.
Comment string
CopyToCpu bool
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
Disabled bool
Dscp float64
Matching DSCP field of the packet.
DstAddress string
Matching destination IP address and mask.
DstAddress6 string
Matching destination IPv6 address and mask.
DstMacAddress string
Matching destination MAC address and mask.
DstPort float64
Matching destination protocol port number or range.
Dynamic bool
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
FlowLabel float64
Matching IPv6 flow label.
InterfaceEthernetSwitchRuleId string
The ID of this resource.
Invalid bool
MacProtocol string
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
Mirror bool
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
MirrorPorts []string
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
NewDstPorts []string
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
NewVlanId float64
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
NewVlanPriority float64
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
Ports []string
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
Protocol string
Matching particular IP protocol specified by protocol name or number.
Rate float64
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
RedirectToCpu bool
Changes the destination port of a matching packet to the switch CPU.
SrcAddress string
Matching source IP address and mask.
SrcAddress6 string
Matching source IPv6 address and mask.
SrcMacAddress string
Matching source MAC address and mask.
SrcPort float64
Matching source protocol port number or range.
Switch string
Matching switch group on which will the rule apply.
TrafficClass float64
Matching IPv6 traffic class.
VlanHeader string
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
VlanId float64
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
VlanPriority float64
Matching VLAN priority (priority code point).
___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.
comment String
copyToCpu Boolean
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
disabled Boolean
dscp Double
Matching DSCP field of the packet.
dstAddress String
Matching destination IP address and mask.
dstAddress6 String
Matching destination IPv6 address and mask.
dstMacAddress String
Matching destination MAC address and mask.
dstPort Double
Matching destination protocol port number or range.
dynamic Boolean
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
flowLabel Double
Matching IPv6 flow label.
interfaceEthernetSwitchRuleId String
The ID of this resource.
invalid Boolean
macProtocol String
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
mirror Boolean
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
mirrorPorts List<String>
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
newDstPorts List<String>
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
newVlanId Double
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
newVlanPriority Double
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
ports List<String>
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
protocol String
Matching particular IP protocol specified by protocol name or number.
rate Double
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
redirectToCpu Boolean
Changes the destination port of a matching packet to the switch CPU.
srcAddress String
Matching source IP address and mask.
srcAddress6 String
Matching source IPv6 address and mask.
srcMacAddress String
Matching source MAC address and mask.
srcPort Double
Matching source protocol port number or range.
switch_ String
Matching switch group on which will the rule apply.
trafficClass Double
Matching IPv6 traffic class.
vlanHeader String
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanId Double
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanPriority Double
Matching VLAN priority (priority code point).
___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.
comment string
copyToCpu boolean
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
disabled boolean
dscp number
Matching DSCP field of the packet.
dstAddress string
Matching destination IP address and mask.
dstAddress6 string
Matching destination IPv6 address and mask.
dstMacAddress string
Matching destination MAC address and mask.
dstPort number
Matching destination protocol port number or range.
dynamic boolean
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
flowLabel number
Matching IPv6 flow label.
interfaceEthernetSwitchRuleId string
The ID of this resource.
invalid boolean
macProtocol string
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
mirror boolean
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
mirrorPorts string[]
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
newDstPorts string[]
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
newVlanId number
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
newVlanPriority number
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
ports string[]
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
protocol string
Matching particular IP protocol specified by protocol name or number.
rate number
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
redirectToCpu boolean
Changes the destination port of a matching packet to the switch CPU.
srcAddress string
Matching source IP address and mask.
srcAddress6 string
Matching source IPv6 address and mask.
srcMacAddress string
Matching source MAC address and mask.
srcPort number
Matching source protocol port number or range.
switch string
Matching switch group on which will the rule apply.
trafficClass number
Matching IPv6 traffic class.
vlanHeader string
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanId number
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanPriority number
Matching VLAN priority (priority code point).
___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.
comment str
copy_to_cpu bool
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
disabled bool
dscp float
Matching DSCP field of the packet.
dst_address str
Matching destination IP address and mask.
dst_address6 str
Matching destination IPv6 address and mask.
dst_mac_address str
Matching destination MAC address and mask.
dst_port float
Matching destination protocol port number or range.
dynamic bool
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
flow_label float
Matching IPv6 flow label.
interface_ethernet_switch_rule_id str
The ID of this resource.
invalid bool
mac_protocol str
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
mirror bool
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
mirror_ports Sequence[str]
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
new_dst_ports Sequence[str]
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
new_vlan_id float
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
new_vlan_priority float
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
ports Sequence[str]
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
protocol str
Matching particular IP protocol specified by protocol name or number.
rate float
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
redirect_to_cpu bool
Changes the destination port of a matching packet to the switch CPU.
src_address str
Matching source IP address and mask.
src_address6 str
Matching source IPv6 address and mask.
src_mac_address str
Matching source MAC address and mask.
src_port float
Matching source protocol port number or range.
switch str
Matching switch group on which will the rule apply.
traffic_class float
Matching IPv6 traffic class.
vlan_header str
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlan_id float
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlan_priority float
Matching VLAN priority (priority code point).
___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.
comment String
copyToCpu Boolean
Whether to send a frame copy to switch CPU port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
disabled Boolean
dscp Number
Matching DSCP field of the packet.
dstAddress String
Matching destination IP address and mask.
dstAddress6 String
Matching destination IPv6 address and mask.
dstMacAddress String
Matching destination MAC address and mask.
dstPort Number
Matching destination protocol port number or range.
dynamic Boolean
Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
flowLabel Number
Matching IPv6 flow label.
interfaceEthernetSwitchRuleId String
The ID of this resource.
invalid Boolean
macProtocol String
Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
mirror Boolean
Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches).
mirrorPorts List<String>
Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
newDstPorts List<String>
Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted.
newVlanId Number
Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips).
newVlanPriority Number
Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips).
ports List<String>
Name of the interface on which the rule will apply on the received traffic, multiple ports are allowed.
protocol String
Matching particular IP protocol specified by protocol name or number.
rate Number
Sets ingress traffic limitation (bits per second) for matched traffic, can only be applied to the first 32 rule slots (the property only applies to Atheros8327/QCA8337 switch chips).
redirectToCpu Boolean
Changes the destination port of a matching packet to the switch CPU.
srcAddress String
Matching source IP address and mask.
srcAddress6 String
Matching source IPv6 address and mask.
srcMacAddress String
Matching source MAC address and mask.
srcPort Number
Matching source protocol port number or range.
switch String
Matching switch group on which will the rule apply.
trafficClass Number
Matching IPv6 traffic class.
vlanHeader String
Matching VLAN header, whether the VLAN header is present or not (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanId Number
Matching VLAN ID (the property only applies to the Atheros8316, Atheros8327, QCA8337, 88E6393X switch chips).
vlanPriority Number
Matching VLAN priority (priority code point).

Import

#The ID can be found via API or the terminal

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

$ pulumi import routeros:index/interfaceEthernetSwitchRule:InterfaceEthernetSwitchRule test *0
Copy

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.