netbox.Interface
Explore with Pulumi AI
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:
- Virtual
Machine doubleId - Description string
- Enabled bool
- Defaults to
true
. - Interface
Id string - The ID of this resource.
- Mac
Address string - Mode string
- Valid values are
access
,tagged
andtagged-all
. - Mtu double
- Name string
- Tagged
Vlans List<double> - List<string>
- Type string
- Untagged
Vlan double
- Virtual
Machine float64Id - Description string
- Enabled bool
- Defaults to
true
. - Interface
Id string - The ID of this resource.
- Mac
Address string - Mode string
- Valid values are
access
,tagged
andtagged-all
. - Mtu float64
- Name string
- Tagged
Vlans []float64 - []string
- Type string
- Untagged
Vlan float64
- virtual
Machine DoubleId - description String
- enabled Boolean
- Defaults to
true
. - interface
Id String - The ID of this resource.
- mac
Address String - mode String
- Valid values are
access
,tagged
andtagged-all
. - mtu Double
- name String
- tagged
Vlans List<Double> - List<String>
- type String
- untagged
Vlan Double
- virtual
Machine numberId - description string
- enabled boolean
- Defaults to
true
. - interface
Id string - The ID of this resource.
- mac
Address string - mode string
- Valid values are
access
,tagged
andtagged-all
. - mtu number
- name string
- tagged
Vlans number[] - string[]
- type string
- untagged
Vlan number
- virtual_
machine_ floatid - 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
andtagged-all
. - mtu float
- name str
- tagged_
vlans Sequence[float] - Sequence[str]
- type str
- untagged_
vlan float
- virtual
Machine NumberId - description String
- enabled Boolean
- Defaults to
true
. - interface
Id String - The ID of this resource.
- mac
Address String - mode String
- Valid values are
access
,tagged
andtagged-all
. - mtu Number
- name String
- tagged
Vlans List<Number> - List<String>
- type String
- untagged
Vlan 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.
- Description string
- Enabled bool
- Defaults to
true
. - Interface
Id string - The ID of this resource.
- Mac
Address string - Mode string
- Valid values are
access
,tagged
andtagged-all
. - Mtu double
- Name string
- Tagged
Vlans List<double> - List<string>
- Type string
- Untagged
Vlan double - Virtual
Machine doubleId
- Description string
- Enabled bool
- Defaults to
true
. - Interface
Id string - The ID of this resource.
- Mac
Address string - Mode string
- Valid values are
access
,tagged
andtagged-all
. - Mtu float64
- Name string
- Tagged
Vlans []float64 - []string
- Type string
- Untagged
Vlan float64 - Virtual
Machine float64Id
- description String
- enabled Boolean
- Defaults to
true
. - interface
Id String - The ID of this resource.
- mac
Address String - mode String
- Valid values are
access
,tagged
andtagged-all
. - mtu Double
- name String
- tagged
Vlans List<Double> - List<String>
- type String
- untagged
Vlan Double - virtual
Machine DoubleId
- description string
- enabled boolean
- Defaults to
true
. - interface
Id string - The ID of this resource.
- mac
Address string - mode string
- Valid values are
access
,tagged
andtagged-all
. - mtu number
- name string
- tagged
Vlans number[] - string[]
- type string
- untagged
Vlan number - virtual
Machine numberId
- 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
andtagged-all
. - mtu float
- name str
- tagged_
vlans Sequence[float] - Sequence[str]
- type str
- untagged_
vlan float - virtual_
machine_ floatid
- description String
- enabled Boolean
- Defaults to
true
. - interface
Id String - The ID of this resource.
- mac
Address String - mode String
- Valid values are
access
,tagged
andtagged-all
. - mtu Number
- name String
- tagged
Vlans List<Number> - List<String>
- type String
- untagged
Vlan Number - virtual
Machine NumberId
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.