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

netbox.Interface

Explore with Pulumi AI

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

    From the official documentation:

    Virtual machine interfaces behave similarly to device interfaces, and can be assigned to VRFs, and may have IP addresses, VLANs, and services attached to them. However, given their virtual nature, they lack properties pertaining to physical attributes. For example, VM interfaces do not have a physical type and cannot have cables attached to them.

    Create Interface Resource

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

    Constructor syntax

    new Interface(name: string, args: InterfaceArgs, opts?: CustomResourceOptions);
    @overload
    def Interface(resource_name: str,
                  args: InterfaceArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def Interface(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  virtual_machine_id: Optional[float] = None,
                  description: Optional[str] = None,
                  enabled: Optional[bool] = None,
                  interface_id: Optional[str] = None,
                  mac_address: Optional[str] = None,
                  mode: Optional[str] = None,
                  mtu: Optional[float] = None,
                  name: Optional[str] = None,
                  tagged_vlans: Optional[Sequence[float]] = None,
                  tags: Optional[Sequence[str]] = None,
                  type: Optional[str] = None,
                  untagged_vlan: Optional[float] = None)
    func NewInterface(ctx *Context, name string, args InterfaceArgs, opts ...ResourceOption) (*Interface, error)
    public Interface(string name, InterfaceArgs args, CustomResourceOptions? opts = null)
    public Interface(String name, InterfaceArgs args)
    public Interface(String name, InterfaceArgs args, CustomResourceOptions options)
    
    type: netbox:Interface
    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 InterfaceArgs
    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 InterfaceArgs
    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 InterfaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InterfaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InterfaceArgs
    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 interfaceResource = new Netbox.Interface("interfaceResource", new()
    {
        VirtualMachineId = 0,
        Description = "string",
        Enabled = false,
        InterfaceId = "string",
        MacAddress = "string",
        Mode = "string",
        Mtu = 0,
        Name = "string",
        TaggedVlans = new[]
        {
            0,
        },
        Tags = new[]
        {
            "string",
        },
        UntaggedVlan = 0,
    });
    
    example, err := netbox.NewInterface(ctx, "interfaceResource", &netbox.InterfaceArgs{
    	VirtualMachineId: pulumi.Float64(0),
    	Description:      pulumi.String("string"),
    	Enabled:          pulumi.Bool(false),
    	InterfaceId:      pulumi.String("string"),
    	MacAddress:       pulumi.String("string"),
    	Mode:             pulumi.String("string"),
    	Mtu:              pulumi.Float64(0),
    	Name:             pulumi.String("string"),
    	TaggedVlans: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	UntaggedVlan: pulumi.Float64(0),
    })
    
    var interfaceResource = new Interface("interfaceResource", InterfaceArgs.builder()
        .virtualMachineId(0)
        .description("string")
        .enabled(false)
        .interfaceId("string")
        .macAddress("string")
        .mode("string")
        .mtu(0)
        .name("string")
        .taggedVlans(0)
        .tags("string")
        .untaggedVlan(0)
        .build());
    
    interface_resource = netbox.Interface("interfaceResource",
        virtual_machine_id=0,
        description="string",
        enabled=False,
        interface_id="string",
        mac_address="string",
        mode="string",
        mtu=0,
        name="string",
        tagged_vlans=[0],
        tags=["string"],
        untagged_vlan=0)
    
    const interfaceResource = new netbox.Interface("interfaceResource", {
        virtualMachineId: 0,
        description: "string",
        enabled: false,
        interfaceId: "string",
        macAddress: "string",
        mode: "string",
        mtu: 0,
        name: "string",
        taggedVlans: [0],
        tags: ["string"],
        untaggedVlan: 0,
    });
    
    type: netbox:Interface
    properties:
        description: string
        enabled: false
        interfaceId: string
        macAddress: string
        mode: string
        mtu: 0
        name: string
        taggedVlans:
            - 0
        tags:
            - string
        untaggedVlan: 0
        virtualMachineId: 0
    

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

    VirtualMachineId double
    Description string
    Enabled bool
    Defaults to true.
    InterfaceId string
    The ID of this resource.
    MacAddress string
    Mode string
    Valid values are access, tagged and tagged-all.
    Mtu double
    Name string
    TaggedVlans List<double>
    Tags List<string>
    Type string

    Deprecated: Deprecated

    UntaggedVlan double
    VirtualMachineId float64
    Description string
    Enabled bool
    Defaults to true.
    InterfaceId string
    The ID of this resource.
    MacAddress string
    Mode string
    Valid values are access, tagged and tagged-all.
    Mtu float64
    Name string
    TaggedVlans []float64
    Tags []string
    Type string

    Deprecated: Deprecated

    UntaggedVlan float64
    virtualMachineId Double
    description String
    enabled Boolean
    Defaults to true.
    interfaceId String
    The ID of this resource.
    macAddress String
    mode String
    Valid values are access, tagged and tagged-all.
    mtu Double
    name String
    taggedVlans List<Double>
    tags List<String>
    type String

    Deprecated: Deprecated

    untaggedVlan Double
    virtualMachineId number
    description string
    enabled boolean
    Defaults to true.
    interfaceId string
    The ID of this resource.
    macAddress string
    mode string
    Valid values are access, tagged and tagged-all.
    mtu number
    name string
    taggedVlans number[]
    tags string[]
    type string

    Deprecated: Deprecated

    untaggedVlan number
    virtual_machine_id float
    description str
    enabled bool
    Defaults to true.
    interface_id str
    The ID of this resource.
    mac_address str
    mode str
    Valid values are access, tagged and tagged-all.
    mtu float
    name str
    tagged_vlans Sequence[float]
    tags Sequence[str]
    type str

    Deprecated: Deprecated

    untagged_vlan float
    virtualMachineId Number
    description String
    enabled Boolean
    Defaults to true.
    interfaceId String
    The ID of this resource.
    macAddress String
    mode String
    Valid values are access, tagged and tagged-all.
    mtu Number
    name String
    taggedVlans List<Number>
    tags List<String>
    type String

    Deprecated: Deprecated

    untaggedVlan Number

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Interface 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 Interface Resource

    Get an existing Interface 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?: InterfaceState, opts?: CustomResourceOptions): Interface
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            interface_id: Optional[str] = None,
            mac_address: Optional[str] = None,
            mode: Optional[str] = None,
            mtu: Optional[float] = None,
            name: Optional[str] = None,
            tagged_vlans: Optional[Sequence[float]] = None,
            tags: Optional[Sequence[str]] = None,
            type: Optional[str] = None,
            untagged_vlan: Optional[float] = None,
            virtual_machine_id: Optional[float] = None) -> Interface
    func GetInterface(ctx *Context, name string, id IDInput, state *InterfaceState, opts ...ResourceOption) (*Interface, error)
    public static Interface Get(string name, Input<string> id, InterfaceState? state, CustomResourceOptions? opts = null)
    public static Interface get(String name, Output<String> id, InterfaceState state, CustomResourceOptions options)
    resources:  _:    type: netbox:Interface    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
    Enabled bool
    Defaults to true.
    InterfaceId string
    The ID of this resource.
    MacAddress string
    Mode string
    Valid values are access, tagged and tagged-all.
    Mtu double
    Name string
    TaggedVlans List<double>
    Tags List<string>
    Type string

    Deprecated: Deprecated

    UntaggedVlan double
    VirtualMachineId double
    Description string
    Enabled bool
    Defaults to true.
    InterfaceId string
    The ID of this resource.
    MacAddress string
    Mode string
    Valid values are access, tagged and tagged-all.
    Mtu float64
    Name string
    TaggedVlans []float64
    Tags []string
    Type string

    Deprecated: Deprecated

    UntaggedVlan float64
    VirtualMachineId float64
    description String
    enabled Boolean
    Defaults to true.
    interfaceId String
    The ID of this resource.
    macAddress String
    mode String
    Valid values are access, tagged and tagged-all.
    mtu Double
    name String
    taggedVlans List<Double>
    tags List<String>
    type String

    Deprecated: Deprecated

    untaggedVlan Double
    virtualMachineId Double
    description string
    enabled boolean
    Defaults to true.
    interfaceId string
    The ID of this resource.
    macAddress string
    mode string
    Valid values are access, tagged and tagged-all.
    mtu number
    name string
    taggedVlans number[]
    tags string[]
    type string

    Deprecated: Deprecated

    untaggedVlan number
    virtualMachineId number
    description str
    enabled bool
    Defaults to true.
    interface_id str
    The ID of this resource.
    mac_address str
    mode str
    Valid values are access, tagged and tagged-all.
    mtu float
    name str
    tagged_vlans Sequence[float]
    tags Sequence[str]
    type str

    Deprecated: Deprecated

    untagged_vlan float
    virtual_machine_id float
    description String
    enabled Boolean
    Defaults to true.
    interfaceId String
    The ID of this resource.
    macAddress String
    mode String
    Valid values are access, tagged and tagged-all.
    mtu Number
    name String
    taggedVlans List<Number>
    tags List<String>
    type String

    Deprecated: Deprecated

    untaggedVlan Number
    virtualMachineId 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