1. Packages
  2. Netbox Provider
  3. API Docs
  4. DeviceInterface
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

netbox.DeviceInterface

Explore with Pulumi AI

netbox logo
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

    From the official documentation:

    Interfaces in NetBox represent network interfaces used to exchange data with connected devices. On modern networks, these are most commonly Ethernet, but other types are supported as well. IP addresses and VLANs can be assigned to interfaces.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    // Assumes a device with ID 123 exists
    const test = new netbox.DeviceInterface("test", {
        deviceId: 123,
        type: "1000base-t",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    # Assumes a device with ID 123 exists
    test = netbox.DeviceInterface("test",
        device_id=123,
        type="1000base-t")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Assumes a device with ID 123 exists
    		_, err := netbox.NewDeviceInterface(ctx, "test", &netbox.DeviceInterfaceArgs{
    			DeviceId: pulumi.Float64(123),
    			Type:     pulumi.String("1000base-t"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Netbox = Pulumi.Netbox;
    
    return await Deployment.RunAsync(() => 
    {
        // Assumes a device with ID 123 exists
        var test = new Netbox.DeviceInterface("test", new()
        {
            DeviceId = 123,
            Type = "1000base-t",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.DeviceInterface;
    import com.pulumi.netbox.DeviceInterfaceArgs;
    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) {
            // Assumes a device with ID 123 exists
            var test = new DeviceInterface("test", DeviceInterfaceArgs.builder()
                .deviceId(123)
                .type("1000base-t")
                .build());
    
        }
    }
    
    resources:
      # Assumes a device with ID 123 exists
      test:
        type: netbox:DeviceInterface
        properties:
          deviceId: 123
          type: 1000base-t
    

    Create DeviceInterface Resource

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

    Constructor syntax

    new DeviceInterface(name: string, args: DeviceInterfaceArgs, opts?: CustomResourceOptions);
    @overload
    def DeviceInterface(resource_name: str,
                        args: DeviceInterfaceArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def DeviceInterface(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        type: Optional[str] = None,
                        device_id: Optional[float] = None,
                        mode: Optional[str] = None,
                        mtu: Optional[float] = None,
                        label: Optional[str] = None,
                        lag_device_interface_id: Optional[float] = None,
                        mac_address: Optional[str] = None,
                        mgmtonly: Optional[bool] = None,
                        description: Optional[str] = None,
                        enabled: Optional[bool] = None,
                        name: Optional[str] = None,
                        parent_device_interface_id: Optional[float] = None,
                        speed: Optional[float] = None,
                        tagged_vlans: Optional[Sequence[float]] = None,
                        tags: Optional[Sequence[str]] = None,
                        device_interface_id: Optional[str] = None,
                        untagged_vlan: Optional[float] = None)
    func NewDeviceInterface(ctx *Context, name string, args DeviceInterfaceArgs, opts ...ResourceOption) (*DeviceInterface, error)
    public DeviceInterface(string name, DeviceInterfaceArgs args, CustomResourceOptions? opts = null)
    public DeviceInterface(String name, DeviceInterfaceArgs args)
    public DeviceInterface(String name, DeviceInterfaceArgs args, CustomResourceOptions options)
    
    type: netbox:DeviceInterface
    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 DeviceInterfaceArgs
    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 DeviceInterfaceArgs
    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 DeviceInterfaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DeviceInterfaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DeviceInterfaceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var deviceInterfaceResource = new Netbox.DeviceInterface("deviceInterfaceResource", new()
    {
        Type = "string",
        DeviceId = 0,
        Mode = "string",
        Mtu = 0,
        Label = "string",
        LagDeviceInterfaceId = 0,
        MacAddress = "string",
        Mgmtonly = false,
        Description = "string",
        Enabled = false,
        Name = "string",
        ParentDeviceInterfaceId = 0,
        Speed = 0,
        TaggedVlans = new[]
        {
            0,
        },
        Tags = new[]
        {
            "string",
        },
        DeviceInterfaceId = "string",
        UntaggedVlan = 0,
    });
    
    example, err := netbox.NewDeviceInterface(ctx, "deviceInterfaceResource", &netbox.DeviceInterfaceArgs{
    	Type:                    pulumi.String("string"),
    	DeviceId:                pulumi.Float64(0),
    	Mode:                    pulumi.String("string"),
    	Mtu:                     pulumi.Float64(0),
    	Label:                   pulumi.String("string"),
    	LagDeviceInterfaceId:    pulumi.Float64(0),
    	MacAddress:              pulumi.String("string"),
    	Mgmtonly:                pulumi.Bool(false),
    	Description:             pulumi.String("string"),
    	Enabled:                 pulumi.Bool(false),
    	Name:                    pulumi.String("string"),
    	ParentDeviceInterfaceId: pulumi.Float64(0),
    	Speed:                   pulumi.Float64(0),
    	TaggedVlans: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	DeviceInterfaceId: pulumi.String("string"),
    	UntaggedVlan:      pulumi.Float64(0),
    })
    
    var deviceInterfaceResource = new DeviceInterface("deviceInterfaceResource", DeviceInterfaceArgs.builder()
        .type("string")
        .deviceId(0)
        .mode("string")
        .mtu(0)
        .label("string")
        .lagDeviceInterfaceId(0)
        .macAddress("string")
        .mgmtonly(false)
        .description("string")
        .enabled(false)
        .name("string")
        .parentDeviceInterfaceId(0)
        .speed(0)
        .taggedVlans(0)
        .tags("string")
        .deviceInterfaceId("string")
        .untaggedVlan(0)
        .build());
    
    device_interface_resource = netbox.DeviceInterface("deviceInterfaceResource",
        type="string",
        device_id=0,
        mode="string",
        mtu=0,
        label="string",
        lag_device_interface_id=0,
        mac_address="string",
        mgmtonly=False,
        description="string",
        enabled=False,
        name="string",
        parent_device_interface_id=0,
        speed=0,
        tagged_vlans=[0],
        tags=["string"],
        device_interface_id="string",
        untagged_vlan=0)
    
    const deviceInterfaceResource = new netbox.DeviceInterface("deviceInterfaceResource", {
        type: "string",
        deviceId: 0,
        mode: "string",
        mtu: 0,
        label: "string",
        lagDeviceInterfaceId: 0,
        macAddress: "string",
        mgmtonly: false,
        description: "string",
        enabled: false,
        name: "string",
        parentDeviceInterfaceId: 0,
        speed: 0,
        taggedVlans: [0],
        tags: ["string"],
        deviceInterfaceId: "string",
        untaggedVlan: 0,
    });
    
    type: netbox:DeviceInterface
    properties:
        description: string
        deviceId: 0
        deviceInterfaceId: string
        enabled: false
        label: string
        lagDeviceInterfaceId: 0
        macAddress: string
        mgmtonly: false
        mode: string
        mtu: 0
        name: string
        parentDeviceInterfaceId: 0
        speed: 0
        taggedVlans:
            - 0
        tags:
            - string
        type: string
        untaggedVlan: 0
    

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

    DeviceId double
    Type string
    Description string
    DeviceInterfaceId string
    The ID of this resource.
    Enabled bool
    Defaults to true.
    Label string
    LagDeviceInterfaceId double
    If this device is a member of a LAG group, you can reference the LAG interface here.
    MacAddress string
    Mgmtonly bool
    Mode string
    Valid values are access, tagged and tagged-all.
    Mtu double
    Name string
    ParentDeviceInterfaceId double
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    Speed double
    TaggedVlans List<double>
    Tags List<string>
    UntaggedVlan double
    DeviceId float64
    Type string
    Description string
    DeviceInterfaceId string
    The ID of this resource.
    Enabled bool
    Defaults to true.
    Label string
    LagDeviceInterfaceId float64
    If this device is a member of a LAG group, you can reference the LAG interface here.
    MacAddress string
    Mgmtonly bool
    Mode string
    Valid values are access, tagged and tagged-all.
    Mtu float64
    Name string
    ParentDeviceInterfaceId float64
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    Speed float64
    TaggedVlans []float64
    Tags []string
    UntaggedVlan float64
    deviceId Double
    type String
    description String
    deviceInterfaceId String
    The ID of this resource.
    enabled Boolean
    Defaults to true.
    label String
    lagDeviceInterfaceId Double
    If this device is a member of a LAG group, you can reference the LAG interface here.
    macAddress String
    mgmtonly Boolean
    mode String
    Valid values are access, tagged and tagged-all.
    mtu Double
    name String
    parentDeviceInterfaceId Double
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    speed Double
    taggedVlans List<Double>
    tags List<String>
    untaggedVlan Double
    deviceId number
    type string
    description string
    deviceInterfaceId string
    The ID of this resource.
    enabled boolean
    Defaults to true.
    label string
    lagDeviceInterfaceId number
    If this device is a member of a LAG group, you can reference the LAG interface here.
    macAddress string
    mgmtonly boolean
    mode string
    Valid values are access, tagged and tagged-all.
    mtu number
    name string
    parentDeviceInterfaceId number
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    speed number
    taggedVlans number[]
    tags string[]
    untaggedVlan number
    device_id float
    type str
    description str
    device_interface_id str
    The ID of this resource.
    enabled bool
    Defaults to true.
    label str
    lag_device_interface_id float
    If this device is a member of a LAG group, you can reference the LAG interface here.
    mac_address str
    mgmtonly bool
    mode str
    Valid values are access, tagged and tagged-all.
    mtu float
    name str
    parent_device_interface_id float
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    speed float
    tagged_vlans Sequence[float]
    tags Sequence[str]
    untagged_vlan float
    deviceId Number
    type String
    description String
    deviceInterfaceId String
    The ID of this resource.
    enabled Boolean
    Defaults to true.
    label String
    lagDeviceInterfaceId Number
    If this device is a member of a LAG group, you can reference the LAG interface here.
    macAddress String
    mgmtonly Boolean
    mode String
    Valid values are access, tagged and tagged-all.
    mtu Number
    name String
    parentDeviceInterfaceId Number
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    speed Number
    taggedVlans List<Number>
    tags List<String>
    untaggedVlan Number

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DeviceInterface Resource

    Get an existing DeviceInterface 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?: DeviceInterfaceState, opts?: CustomResourceOptions): DeviceInterface
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            device_id: Optional[float] = None,
            device_interface_id: Optional[str] = None,
            enabled: Optional[bool] = None,
            label: Optional[str] = None,
            lag_device_interface_id: Optional[float] = None,
            mac_address: Optional[str] = None,
            mgmtonly: Optional[bool] = None,
            mode: Optional[str] = None,
            mtu: Optional[float] = None,
            name: Optional[str] = None,
            parent_device_interface_id: Optional[float] = None,
            speed: Optional[float] = None,
            tagged_vlans: Optional[Sequence[float]] = None,
            tags: Optional[Sequence[str]] = None,
            type: Optional[str] = None,
            untagged_vlan: Optional[float] = None) -> DeviceInterface
    func GetDeviceInterface(ctx *Context, name string, id IDInput, state *DeviceInterfaceState, opts ...ResourceOption) (*DeviceInterface, error)
    public static DeviceInterface Get(string name, Input<string> id, DeviceInterfaceState? state, CustomResourceOptions? opts = null)
    public static DeviceInterface get(String name, Output<String> id, DeviceInterfaceState state, CustomResourceOptions options)
    resources:  _:    type: netbox:DeviceInterface    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:
    Description string
    DeviceId double
    DeviceInterfaceId string
    The ID of this resource.
    Enabled bool
    Defaults to true.
    Label string
    LagDeviceInterfaceId double
    If this device is a member of a LAG group, you can reference the LAG interface here.
    MacAddress string
    Mgmtonly bool
    Mode string
    Valid values are access, tagged and tagged-all.
    Mtu double
    Name string
    ParentDeviceInterfaceId double
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    Speed double
    TaggedVlans List<double>
    Tags List<string>
    Type string
    UntaggedVlan double
    Description string
    DeviceId float64
    DeviceInterfaceId string
    The ID of this resource.
    Enabled bool
    Defaults to true.
    Label string
    LagDeviceInterfaceId float64
    If this device is a member of a LAG group, you can reference the LAG interface here.
    MacAddress string
    Mgmtonly bool
    Mode string
    Valid values are access, tagged and tagged-all.
    Mtu float64
    Name string
    ParentDeviceInterfaceId float64
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    Speed float64
    TaggedVlans []float64
    Tags []string
    Type string
    UntaggedVlan float64
    description String
    deviceId Double
    deviceInterfaceId String
    The ID of this resource.
    enabled Boolean
    Defaults to true.
    label String
    lagDeviceInterfaceId Double
    If this device is a member of a LAG group, you can reference the LAG interface here.
    macAddress String
    mgmtonly Boolean
    mode String
    Valid values are access, tagged and tagged-all.
    mtu Double
    name String
    parentDeviceInterfaceId Double
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    speed Double
    taggedVlans List<Double>
    tags List<String>
    type String
    untaggedVlan Double
    description string
    deviceId number
    deviceInterfaceId string
    The ID of this resource.
    enabled boolean
    Defaults to true.
    label string
    lagDeviceInterfaceId number
    If this device is a member of a LAG group, you can reference the LAG interface here.
    macAddress string
    mgmtonly boolean
    mode string
    Valid values are access, tagged and tagged-all.
    mtu number
    name string
    parentDeviceInterfaceId number
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    speed number
    taggedVlans number[]
    tags string[]
    type string
    untaggedVlan number
    description str
    device_id float
    device_interface_id str
    The ID of this resource.
    enabled bool
    Defaults to true.
    label str
    lag_device_interface_id float
    If this device is a member of a LAG group, you can reference the LAG interface here.
    mac_address str
    mgmtonly bool
    mode str
    Valid values are access, tagged and tagged-all.
    mtu float
    name str
    parent_device_interface_id float
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    speed float
    tagged_vlans Sequence[float]
    tags Sequence[str]
    type str
    untagged_vlan float
    description String
    deviceId Number
    deviceInterfaceId String
    The ID of this resource.
    enabled Boolean
    Defaults to true.
    label String
    lagDeviceInterfaceId Number
    If this device is a member of a LAG group, you can reference the LAG interface here.
    macAddress String
    mgmtonly Boolean
    mode String
    Valid values are access, tagged and tagged-all.
    mtu Number
    name String
    parentDeviceInterfaceId Number
    The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
    speed Number
    taggedVlans List<Number>
    tags List<String>
    type String
    untaggedVlan Number

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    netbox logo
    netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger