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

routeros.InterfaceEthernetSwitchVlan

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.InterfaceEthernetSwitchVlan("test", {
        independentLearning: true,
        ports: ["ether1"],
        "switch": "switch1",
        vlanId: 10,
    });
    
    import pulumi
    import pulumi_routeros as routeros
    
    test = routeros.InterfaceEthernetSwitchVlan("test",
        independent_learning=True,
        ports=["ether1"],
        switch="switch1",
        vlan_id=10)
    
    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.NewInterfaceEthernetSwitchVlan(ctx, "test", &routeros.InterfaceEthernetSwitchVlanArgs{
    			IndependentLearning: pulumi.Bool(true),
    			Ports: pulumi.StringArray{
    				pulumi.String("ether1"),
    			},
    			Switch: pulumi.String("switch1"),
    			VlanId: pulumi.Float64(10),
    		})
    		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.InterfaceEthernetSwitchVlan("test", new()
        {
            IndependentLearning = true,
            Ports = new[]
            {
                "ether1",
            },
            Switch = "switch1",
            VlanId = 10,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.routeros.InterfaceEthernetSwitchVlan;
    import com.pulumi.routeros.InterfaceEthernetSwitchVlanArgs;
    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 InterfaceEthernetSwitchVlan("test", InterfaceEthernetSwitchVlanArgs.builder()
                .independentLearning(true)
                .ports("ether1")
                .switch_("switch1")
                .vlanId(10)
                .build());
    
        }
    }
    
    resources:
      test:
        type: routeros:InterfaceEthernetSwitchVlan
        properties:
          independentLearning: true
          ports:
            - ether1
          switch: switch1
          vlanId: 10
    

    Create InterfaceEthernetSwitchVlan Resource

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

    Constructor syntax

    new InterfaceEthernetSwitchVlan(name: string, args: InterfaceEthernetSwitchVlanArgs, opts?: CustomResourceOptions);
    @overload
    def InterfaceEthernetSwitchVlan(resource_name: str,
                                    args: InterfaceEthernetSwitchVlanArgs,
                                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def InterfaceEthernetSwitchVlan(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    ports: Optional[Sequence[str]] = None,
                                    switch: Optional[str] = None,
                                    ___id_: Optional[float] = None,
                                    ___path_: Optional[str] = None,
                                    comment: Optional[str] = None,
                                    disabled: Optional[bool] = None,
                                    independent_learning: Optional[bool] = None,
                                    interface_ethernet_switch_vlan_id: Optional[str] = None,
                                    vlan_id: Optional[float] = None)
    func NewInterfaceEthernetSwitchVlan(ctx *Context, name string, args InterfaceEthernetSwitchVlanArgs, opts ...ResourceOption) (*InterfaceEthernetSwitchVlan, error)
    public InterfaceEthernetSwitchVlan(string name, InterfaceEthernetSwitchVlanArgs args, CustomResourceOptions? opts = null)
    public InterfaceEthernetSwitchVlan(String name, InterfaceEthernetSwitchVlanArgs args)
    public InterfaceEthernetSwitchVlan(String name, InterfaceEthernetSwitchVlanArgs args, CustomResourceOptions options)
    
    type: routeros:InterfaceEthernetSwitchVlan
    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 InterfaceEthernetSwitchVlanArgs
    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 InterfaceEthernetSwitchVlanArgs
    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 InterfaceEthernetSwitchVlanArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InterfaceEthernetSwitchVlanArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InterfaceEthernetSwitchVlanArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Ports List<string>
    Interface member list for the respective VLAN.
    Switch string
    Name of the switch for which the respective VLAN entry is intended for.
    Comment string
    Disabled bool
    IndependentLearning bool
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    InterfaceEthernetSwitchVlanId string
    The ID of this resource.
    VlanId double
    The VLAN ID for certain switch port configurations.
    ___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 []string
    Interface member list for the respective VLAN.
    Switch string
    Name of the switch for which the respective VLAN entry is intended for.
    Comment string
    Disabled bool
    IndependentLearning bool
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    InterfaceEthernetSwitchVlanId string
    The ID of this resource.
    VlanId float64
    The VLAN ID for certain switch port configurations.
    ___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 List<String>
    Interface member list for the respective VLAN.
    switch_ String
    Name of the switch for which the respective VLAN entry is intended for.
    ___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
    disabled Boolean
    independentLearning Boolean
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    interfaceEthernetSwitchVlanId String
    The ID of this resource.
    vlanId Double
    The VLAN ID for certain switch port configurations.
    ports string[]
    Interface member list for the respective VLAN.
    switch string
    Name of the switch for which the respective VLAN entry is intended for.
    ___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
    disabled boolean
    independentLearning boolean
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    interfaceEthernetSwitchVlanId string
    The ID of this resource.
    vlanId number
    The VLAN ID for certain switch port configurations.
    ports Sequence[str]
    Interface member list for the respective VLAN.
    switch str
    Name of the switch for which the respective VLAN entry is intended for.
    ___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
    disabled bool
    independent_learning bool
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    interface_ethernet_switch_vlan_id str
    The ID of this resource.
    vlan_id float
    The VLAN ID for certain switch port configurations.
    ports List<String>
    Interface member list for the respective VLAN.
    switch String
    Name of the switch for which the respective VLAN entry is intended for.
    ___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
    disabled Boolean
    independentLearning Boolean
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    interfaceEthernetSwitchVlanId String
    The ID of this resource.
    vlanId Number
    The VLAN ID for certain switch port configurations.

    Outputs

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

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

    Look up Existing InterfaceEthernetSwitchVlan Resource

    Get an existing InterfaceEthernetSwitchVlan 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?: InterfaceEthernetSwitchVlanState, opts?: CustomResourceOptions): InterfaceEthernetSwitchVlan
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ___id_: Optional[float] = None,
            ___path_: Optional[str] = None,
            comment: Optional[str] = None,
            disabled: Optional[bool] = None,
            independent_learning: Optional[bool] = None,
            interface_ethernet_switch_vlan_id: Optional[str] = None,
            invalid: Optional[bool] = None,
            ports: Optional[Sequence[str]] = None,
            switch: Optional[str] = None,
            vlan_id: Optional[float] = None) -> InterfaceEthernetSwitchVlan
    func GetInterfaceEthernetSwitchVlan(ctx *Context, name string, id IDInput, state *InterfaceEthernetSwitchVlanState, opts ...ResourceOption) (*InterfaceEthernetSwitchVlan, error)
    public static InterfaceEthernetSwitchVlan Get(string name, Input<string> id, InterfaceEthernetSwitchVlanState? state, CustomResourceOptions? opts = null)
    public static InterfaceEthernetSwitchVlan get(String name, Output<String> id, InterfaceEthernetSwitchVlanState state, CustomResourceOptions options)
    resources:  _:    type: routeros:InterfaceEthernetSwitchVlan    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:
    Comment string
    Disabled bool
    IndependentLearning bool
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    InterfaceEthernetSwitchVlanId string
    The ID of this resource.
    Invalid bool
    Ports List<string>
    Interface member list for the respective VLAN.
    Switch string
    Name of the switch for which the respective VLAN entry is intended for.
    VlanId double
    The VLAN ID for certain switch port configurations.
    ___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
    Disabled bool
    IndependentLearning bool
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    InterfaceEthernetSwitchVlanId string
    The ID of this resource.
    Invalid bool
    Ports []string
    Interface member list for the respective VLAN.
    Switch string
    Name of the switch for which the respective VLAN entry is intended for.
    VlanId float64
    The VLAN ID for certain switch port configurations.
    ___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
    disabled Boolean
    independentLearning Boolean
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    interfaceEthernetSwitchVlanId String
    The ID of this resource.
    invalid Boolean
    ports List<String>
    Interface member list for the respective VLAN.
    switch_ String
    Name of the switch for which the respective VLAN entry is intended for.
    vlanId Double
    The VLAN ID for certain switch port configurations.
    ___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
    disabled boolean
    independentLearning boolean
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    interfaceEthernetSwitchVlanId string
    The ID of this resource.
    invalid boolean
    ports string[]
    Interface member list for the respective VLAN.
    switch string
    Name of the switch for which the respective VLAN entry is intended for.
    vlanId number
    The VLAN ID for certain switch port configurations.
    ___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
    disabled bool
    independent_learning bool
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    interface_ethernet_switch_vlan_id str
    The ID of this resource.
    invalid bool
    ports Sequence[str]
    Interface member list for the respective VLAN.
    switch str
    Name of the switch for which the respective VLAN entry is intended for.
    vlan_id float
    The VLAN ID for certain switch port configurations.
    ___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
    disabled Boolean
    independentLearning Boolean
    Whether to use shared-VLAN-learning (SVL) or independent-VLAN-learning (IVL).
    interfaceEthernetSwitchVlanId String
    The ID of this resource.
    invalid Boolean
    ports List<String>
    Interface member list for the respective VLAN.
    switch String
    Name of the switch for which the respective VLAN entry is intended for.
    vlanId Number
    The VLAN ID for certain switch port configurations.

    Import

    #The ID can be found via API or the terminal

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

    $ pulumi import routeros:index/interfaceEthernetSwitchVlan:InterfaceEthernetSwitchVlan test *0
    

    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