published on Wednesday, Nov 4, 2026 by e-breuninger
published on Wednesday, Nov 4, 2026 by e-breuninger
A virtual device context: a logical partition of a device with its own interfaces and addresses (dcim.virtualdevicecontext).
From the official documentation:
A virtual device context (VDC) represents a logical partition within a physical device, to which interfaces from the parent device can be allocated. Each VDC effectively provides an isolated control plane, but relies on shared resources of the parent device. A VDC is somewhat similar to a virtual machine in that it effects isolation between various components, but stops short of delivering a fully virtualized environment.
Each VDC must be assigned to a device upon creation, after which interfaces belonging to that device can be assigned to one or more of its VDCs. A VDC can have any number of interfaces assigned to it, and an interface can belong to any number of VDCs.
A VDC by Any Other Name: Network vendors use differing names for this concept. Cisco uses the term VDC, whereas Juniper refers to it as a Virtual Routing Instance, and Fortinet uses Virtual Domain, for instance. While there may be some nuance among the vendors’ unique implementations, the general concept remains the same for each.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const test = netbox.getVirtualDeviceContext({
name: "test-virtual_device_context",
});
import pulumi
import pulumi_netbox as netbox
test = netbox.get_virtual_device_context(name="test-virtual_device_context")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v6/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := netbox.LookupVirtualDeviceContext(ctx, &netbox.LookupVirtualDeviceContextArgs{
Name: pulumi.StringRef("test-virtual_device_context"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
var test = Netbox.GetVirtualDeviceContext.Invoke(new()
{
Name = "test-virtual_device_context",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.NetboxFunctions;
import com.pulumi.netbox.inputs.GetVirtualDeviceContextArgs;
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) {
final var test = NetboxFunctions.getVirtualDeviceContext(GetVirtualDeviceContextArgs.builder()
.name("test-virtual_device_context")
.build());
}
}
variables:
test:
fn::invoke:
function: netbox:getVirtualDeviceContext
arguments:
name: test-virtual_device_context
Example coming soon!
Using getVirtualDeviceContext
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVirtualDeviceContext(args: GetVirtualDeviceContextArgs, opts?: InvokeOptions): Promise<GetVirtualDeviceContextResult>
function getVirtualDeviceContextOutput(args: GetVirtualDeviceContextOutputArgs, opts?: InvokeOutputOptions): Output<GetVirtualDeviceContextResult>def get_virtual_device_context(custom_field_filters: Optional[Mapping[str, str]] = None,
device_id: Optional[float] = None,
id: Optional[float] = None,
identifier: Optional[float] = None,
name: Optional[str] = None,
owner_id: Optional[float] = None,
status: Optional[str] = None,
tag_slug: Optional[str] = None,
tenant_id: Optional[float] = None,
opts: Optional[InvokeOptions] = None) -> GetVirtualDeviceContextResult
def get_virtual_device_context_output(custom_field_filters: pulumi.Input[Optional[Mapping[str, pulumi.Input[str]]]] = None,
device_id: pulumi.Input[Optional[float]] = None,
id: pulumi.Input[Optional[float]] = None,
identifier: pulumi.Input[Optional[float]] = None,
name: pulumi.Input[Optional[str]] = None,
owner_id: pulumi.Input[Optional[float]] = None,
status: pulumi.Input[Optional[str]] = None,
tag_slug: pulumi.Input[Optional[str]] = None,
tenant_id: pulumi.Input[Optional[float]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetVirtualDeviceContextResult]func LookupVirtualDeviceContext(ctx *Context, args *LookupVirtualDeviceContextArgs, opts ...InvokeOption) (*LookupVirtualDeviceContextResult, error)
func LookupVirtualDeviceContextOutput(ctx *Context, args *LookupVirtualDeviceContextOutputArgs, opts ...InvokeOption) LookupVirtualDeviceContextResultOutput> Note: This function is named LookupVirtualDeviceContext in the Go SDK.
public static class GetVirtualDeviceContext
{
public static Task<GetVirtualDeviceContextResult> InvokeAsync(GetVirtualDeviceContextArgs args, InvokeOptions? opts = null)
public static Output<GetVirtualDeviceContextResult> Invoke(GetVirtualDeviceContextInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetVirtualDeviceContextResult> Invoke(GetVirtualDeviceContextInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetVirtualDeviceContextResult> getVirtualDeviceContext(GetVirtualDeviceContextArgs args, InvokeOptions options)
public static Output<GetVirtualDeviceContextResult> getVirtualDeviceContext(GetVirtualDeviceContextArgs args, InvokeOptions options)
public static Output<GetVirtualDeviceContextResult> getVirtualDeviceContext(GetVirtualDeviceContextArgs args, InvokeOutputOptions options)
fn::invoke:
function: netbox:index/getVirtualDeviceContext:getVirtualDeviceContext
arguments:
# arguments dictionarydata "netbox_get_virtual_device_context" "name" {
# arguments
}The following arguments are supported:
- Custom
Field Dictionary<string, string>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- Device
Id double - Id of the device.
- Id double
- NetBox id.
- Identifier double
- Numeric identifier, unique within the device. Must be a whole number.
- Name string
- Owner
Id double - Id of the owner the object is assigned to.
- Status string
- Operational status. One of: active, planned, offline.
- string
- Slug of a tag the object carries.
- Tenant
Id double - Id of the tenant.
- Custom
Field map[string]stringFilters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- Device
Id float64 - Id of the device.
- Id float64
- NetBox id.
- Identifier float64
- Numeric identifier, unique within the device. Must be a whole number.
- Name string
- Owner
Id float64 - Id of the owner the object is assigned to.
- Status string
- Operational status. One of: active, planned, offline.
- string
- Slug of a tag the object carries.
- Tenant
Id float64 - Id of the tenant.
- custom_
field_ map(string)filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- device_
id number - Id of the device.
- id number
- NetBox id.
- identifier number
- Numeric identifier, unique within the device. Must be a whole number.
- name string
- owner_
id number - Id of the owner the object is assigned to.
- status string
- Operational status. One of: active, planned, offline.
- tag_
slug string - Slug of a tag the object carries.
- tenant_
id number - Id of the tenant.
- custom
Field Map<String,String>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- device
Id Double - Id of the device.
- id Double
- NetBox id.
- identifier Double
- Numeric identifier, unique within the device. Must be a whole number.
- name String
- owner
Id Double - Id of the owner the object is assigned to.
- status String
- Operational status. One of: active, planned, offline.
- String
- Slug of a tag the object carries.
- tenant
Id Double - Id of the tenant.
- custom
Field {[key: string]: string}Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- device
Id number - Id of the device.
- id number
- NetBox id.
- identifier number
- Numeric identifier, unique within the device. Must be a whole number.
- name string
- owner
Id number - Id of the owner the object is assigned to.
- status string
- Operational status. One of: active, planned, offline.
- string
- Slug of a tag the object carries.
- tenant
Id number - Id of the tenant.
- custom_
field_ Mapping[str, str]filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- device_
id float - Id of the device.
- id float
- NetBox id.
- identifier float
- Numeric identifier, unique within the device. Must be a whole number.
- name str
- owner_
id float - Id of the owner the object is assigned to.
- status str
- Operational status. One of: active, planned, offline.
- tag_
slug str - Slug of a tag the object carries.
- tenant_
id float - Id of the tenant.
- custom
Field Map<String>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- device
Id Number - Id of the device.
- id Number
- NetBox id.
- identifier Number
- Numeric identifier, unique within the device. Must be a whole number.
- name String
- owner
Id Number - Id of the owner the object is assigned to.
- status String
- Operational status. One of: active, planned, offline.
- String
- Slug of a tag the object carries.
- tenant
Id Number - Id of the tenant.
getVirtualDeviceContext Result
The following output properties are available:
- Comments string
- Created string
- Custom
Fields Dictionary<string, string> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- Description string
- Device
Id double - Id of the device.
- Id double
- NetBox id.
- Identifier double
- Numeric identifier, unique within the device. Must be a whole number.
- Interface
Count double - Number of interfaces assigned to the context.
- Last
Updated string - Name string
- Owner
Id double - Id of the owner the object is assigned to.
- Primary
Ip4Id double - Id of the primary IPv4 address; it must be assigned to an interface of the device.
- Primary
Ip6Id double - Id of the primary IPv6 address; it must be assigned to an interface of the device.
- Status string
- Operational status. One of: active, planned, offline.
- List<string>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<string>
- Slugs of all tags on the object, including the provider's default_tags.
- Tenant
Id double - Id of the tenant.
- Url string
- Custom
Field Dictionary<string, string>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- string
- Slug of a tag the object carries.
- Comments string
- Created string
- Custom
Fields map[string]string - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- Description string
- Device
Id float64 - Id of the device.
- Id float64
- NetBox id.
- Identifier float64
- Numeric identifier, unique within the device. Must be a whole number.
- Interface
Count float64 - Number of interfaces assigned to the context.
- Last
Updated string - Name string
- Owner
Id float64 - Id of the owner the object is assigned to.
- Primary
Ip4Id float64 - Id of the primary IPv4 address; it must be assigned to an interface of the device.
- Primary
Ip6Id float64 - Id of the primary IPv6 address; it must be assigned to an interface of the device.
- Status string
- Operational status. One of: active, planned, offline.
- []string
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- []string
- Slugs of all tags on the object, including the provider's default_tags.
- Tenant
Id float64 - Id of the tenant.
- Url string
- Custom
Field map[string]stringFilters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- string
- Slug of a tag the object carries.
- comments string
- created string
- custom_
fields map(string) - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description string
- device_
id number - Id of the device.
- id number
- NetBox id.
- identifier number
- Numeric identifier, unique within the device. Must be a whole number.
- interface_
count number - Number of interfaces assigned to the context.
- last_
updated string - name string
- owner_
id number - Id of the owner the object is assigned to.
- primary_
ip4_ numberid - Id of the primary IPv4 address; it must be assigned to an interface of the device.
- primary_
ip6_ numberid - Id of the primary IPv6 address; it must be assigned to an interface of the device.
- status string
- Operational status. One of: active, planned, offline.
- list(string)
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- list(string)
- Slugs of all tags on the object, including the provider's default_tags.
- tenant_
id number - Id of the tenant.
- url string
- custom_
field_ map(string)filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- tag_
slug string - Slug of a tag the object carries.
- comments String
- created String
- custom
Fields Map<String,String> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description String
- device
Id Double - Id of the device.
- id Double
- NetBox id.
- identifier Double
- Numeric identifier, unique within the device. Must be a whole number.
- interface
Count Double - Number of interfaces assigned to the context.
- last
Updated String - name String
- owner
Id Double - Id of the owner the object is assigned to.
- primary
Ip4Id Double - Id of the primary IPv4 address; it must be assigned to an interface of the device.
- primary
Ip6Id Double - Id of the primary IPv6 address; it must be assigned to an interface of the device.
- status String
- Operational status. One of: active, planned, offline.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- tenant
Id Double - Id of the tenant.
- url String
- custom
Field Map<String,String>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- String
- Slug of a tag the object carries.
- comments string
- created string
- custom
Fields {[key: string]: string} - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description string
- device
Id number - Id of the device.
- id number
- NetBox id.
- identifier number
- Numeric identifier, unique within the device. Must be a whole number.
- interface
Count number - Number of interfaces assigned to the context.
- last
Updated string - name string
- owner
Id number - Id of the owner the object is assigned to.
- primary
Ip4Id number - Id of the primary IPv4 address; it must be assigned to an interface of the device.
- primary
Ip6Id number - Id of the primary IPv6 address; it must be assigned to an interface of the device.
- status string
- Operational status. One of: active, planned, offline.
- string[]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- string[]
- Slugs of all tags on the object, including the provider's default_tags.
- tenant
Id number - Id of the tenant.
- url string
- custom
Field {[key: string]: string}Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- string
- Slug of a tag the object carries.
- comments str
- created str
- custom_
fields Mapping[str, str] - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description str
- device_
id float - Id of the device.
- id float
- NetBox id.
- identifier float
- Numeric identifier, unique within the device. Must be a whole number.
- interface_
count float - Number of interfaces assigned to the context.
- last_
updated str - name str
- owner_
id float - Id of the owner the object is assigned to.
- primary_
ip4_ floatid - Id of the primary IPv4 address; it must be assigned to an interface of the device.
- primary_
ip6_ floatid - Id of the primary IPv6 address; it must be assigned to an interface of the device.
- status str
- Operational status. One of: active, planned, offline.
- Sequence[str]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Sequence[str]
- Slugs of all tags on the object, including the provider's default_tags.
- tenant_
id float - Id of the tenant.
- url str
- custom_
field_ Mapping[str, str]filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- tag_
slug str - Slug of a tag the object carries.
- comments String
- created String
- custom
Fields Map<String> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description String
- device
Id Number - Id of the device.
- id Number
- NetBox id.
- identifier Number
- Numeric identifier, unique within the device. Must be a whole number.
- interface
Count Number - Number of interfaces assigned to the context.
- last
Updated String - name String
- owner
Id Number - Id of the owner the object is assigned to.
- primary
Ip4Id Number - Id of the primary IPv4 address; it must be assigned to an interface of the device.
- primary
Ip6Id Number - Id of the primary IPv6 address; it must be assigned to an interface of the device.
- status String
- Operational status. One of: active, planned, offline.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- tenant
Id Number - Id of the tenant.
- url String
- custom
Field Map<String>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- String
- Slug of a tag the object carries.
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netboxTerraform Provider.
published on Wednesday, Nov 4, 2026 by e-breuninger