1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. VirtualDeviceContext
Viewing docs for netbox 6.0.0
published on Wednesday, Nov 4, 2026 by e-breuninger
netbox
Viewing docs for netbox 6.0.0
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 = new netbox.Site("test", {name: "test-site"});
    const testManufacturer = new netbox.Manufacturer("test", {name: "test-manufacturer"});
    const testDeviceType = new netbox.DeviceType("test", {
        manufacturerId: testManufacturer.manufacturerId,
        model: "test-device-type",
    });
    const testDeviceRole = new netbox.DeviceRole("test", {name: "test-device-role"});
    const testDevice = new netbox.Device("test", {
        name: "test-device",
        deviceTypeId: testDeviceType.deviceTypeId,
        roleId: testDeviceRole.deviceRoleId,
        siteId: test.siteId,
    });
    const testTenant = new netbox.Tenant("test", {name: "test-tenant"});
    const testVirtualDeviceContext = new netbox.VirtualDeviceContext("test", {
        deviceId: testDevice.deviceId,
        name: "test-virtual-device-context",
        identifier: 10,
        status: "active",
        tenantId: testTenant.tenantId,
        description: "test-description",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.Site("test", name="test-site")
    test_manufacturer = netbox.Manufacturer("test", name="test-manufacturer")
    test_device_type = netbox.DeviceType("test",
        manufacturer_id=test_manufacturer.manufacturer_id,
        model="test-device-type")
    test_device_role = netbox.DeviceRole("test", name="test-device-role")
    test_device = netbox.Device("test",
        name="test-device",
        device_type_id=test_device_type.device_type_id,
        role_id=test_device_role.device_role_id,
        site_id=test.site_id)
    test_tenant = netbox.Tenant("test", name="test-tenant")
    test_virtual_device_context = netbox.VirtualDeviceContext("test",
        device_id=test_device.device_id,
        name="test-virtual-device-context",
        identifier=10,
        status="active",
        tenant_id=test_tenant.tenant_id,
        description="test-description")
    
    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 {
    		test, err := netbox.NewSite(ctx, "test", &netbox.SiteArgs{
    			Name: pulumi.String("test-site"),
    		})
    		if err != nil {
    			return err
    		}
    		testManufacturer, err := netbox.NewManufacturer(ctx, "test", &netbox.ManufacturerArgs{
    			Name: pulumi.String("test-manufacturer"),
    		})
    		if err != nil {
    			return err
    		}
    		testDeviceType, err := netbox.NewDeviceType(ctx, "test", &netbox.DeviceTypeArgs{
    			ManufacturerId: testManufacturer.ManufacturerId,
    			Model:          pulumi.String("test-device-type"),
    		})
    		if err != nil {
    			return err
    		}
    		testDeviceRole, err := netbox.NewDeviceRole(ctx, "test", &netbox.DeviceRoleArgs{
    			Name: pulumi.String("test-device-role"),
    		})
    		if err != nil {
    			return err
    		}
    		testDevice, err := netbox.NewDevice(ctx, "test", &netbox.DeviceArgs{
    			Name:         pulumi.String("test-device"),
    			DeviceTypeId: testDeviceType.DeviceTypeId,
    			RoleId:       testDeviceRole.DeviceRoleId,
    			SiteId:       test.SiteId,
    		})
    		if err != nil {
    			return err
    		}
    		testTenant, err := netbox.NewTenant(ctx, "test", &netbox.TenantArgs{
    			Name: pulumi.String("test-tenant"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewVirtualDeviceContext(ctx, "test", &netbox.VirtualDeviceContextArgs{
    			DeviceId:    testDevice.DeviceId,
    			Name:        pulumi.String("test-virtual-device-context"),
    			Identifier:  pulumi.Float64(10),
    			Status:      pulumi.String("active"),
    			TenantId:    testTenant.TenantId,
    			Description: pulumi.String("test-description"),
    		})
    		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 = new Netbox.Site("test", new()
        {
            Name = "test-site",
        });
    
        var testManufacturer = new Netbox.Manufacturer("test", new()
        {
            Name = "test-manufacturer",
        });
    
        var testDeviceType = new Netbox.DeviceType("test", new()
        {
            ManufacturerId = testManufacturer.ManufacturerId,
            Model = "test-device-type",
        });
    
        var testDeviceRole = new Netbox.DeviceRole("test", new()
        {
            Name = "test-device-role",
        });
    
        var testDevice = new Netbox.Device("test", new()
        {
            Name = "test-device",
            DeviceTypeId = testDeviceType.DeviceTypeId,
            RoleId = testDeviceRole.DeviceRoleId,
            SiteId = test.SiteId,
        });
    
        var testTenant = new Netbox.Tenant("test", new()
        {
            Name = "test-tenant",
        });
    
        var testVirtualDeviceContext = new Netbox.VirtualDeviceContext("test", new()
        {
            DeviceId = testDevice.DeviceId,
            Name = "test-virtual-device-context",
            Identifier = 10,
            Status = "active",
            TenantId = testTenant.TenantId,
            Description = "test-description",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.Site;
    import com.pulumi.netbox.SiteArgs;
    import com.pulumi.netbox.Manufacturer;
    import com.pulumi.netbox.ManufacturerArgs;
    import com.pulumi.netbox.DeviceType;
    import com.pulumi.netbox.DeviceTypeArgs;
    import com.pulumi.netbox.DeviceRole;
    import com.pulumi.netbox.DeviceRoleArgs;
    import com.pulumi.netbox.Device;
    import com.pulumi.netbox.DeviceArgs;
    import com.pulumi.netbox.Tenant;
    import com.pulumi.netbox.TenantArgs;
    import com.pulumi.netbox.VirtualDeviceContext;
    import com.pulumi.netbox.VirtualDeviceContextArgs;
    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 Site("test", SiteArgs.builder()
                .name("test-site")
                .build());
    
            var testManufacturer = new Manufacturer("testManufacturer", ManufacturerArgs.builder()
                .name("test-manufacturer")
                .build());
    
            var testDeviceType = new DeviceType("testDeviceType", DeviceTypeArgs.builder()
                .manufacturerId(testManufacturer.manufacturerId())
                .model("test-device-type")
                .build());
    
            var testDeviceRole = new DeviceRole("testDeviceRole", DeviceRoleArgs.builder()
                .name("test-device-role")
                .build());
    
            var testDevice = new Device("testDevice", DeviceArgs.builder()
                .name("test-device")
                .deviceTypeId(testDeviceType.deviceTypeId())
                .roleId(testDeviceRole.deviceRoleId())
                .siteId(test.siteId())
                .build());
    
            var testTenant = new Tenant("testTenant", TenantArgs.builder()
                .name("test-tenant")
                .build());
    
            var testVirtualDeviceContext = new VirtualDeviceContext("testVirtualDeviceContext", VirtualDeviceContextArgs.builder()
                .deviceId(testDevice.deviceId())
                .name("test-virtual-device-context")
                .identifier(10.0)
                .status("active")
                .tenantId(testTenant.tenantId())
                .description("test-description")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:Site
        properties:
          name: test-site
      testManufacturer:
        type: netbox:Manufacturer
        name: test
        properties:
          name: test-manufacturer
      testDeviceType:
        type: netbox:DeviceType
        name: test
        properties:
          manufacturerId: ${testManufacturer.manufacturerId}
          model: test-device-type
      testDeviceRole:
        type: netbox:DeviceRole
        name: test
        properties:
          name: test-device-role
      testDevice:
        type: netbox:Device
        name: test
        properties:
          name: test-device
          deviceTypeId: ${testDeviceType.deviceTypeId}
          roleId: ${testDeviceRole.deviceRoleId}
          siteId: ${test.siteId}
      testTenant:
        type: netbox:Tenant
        name: test
        properties:
          name: test-tenant
      testVirtualDeviceContext:
        type: netbox:VirtualDeviceContext
        name: test
        properties:
          deviceId: ${testDevice.deviceId}
          name: test-virtual-device-context
          identifier: 10
          status: active
          tenantId: ${testTenant.tenantId}
          description: test-description
    
    Example coming soon!
    

    Create VirtualDeviceContext Resource

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

    Constructor syntax

    new VirtualDeviceContext(name: string, args: VirtualDeviceContextArgs, opts?: CustomResourceOptions);
    @overload
    def VirtualDeviceContext(resource_name: str,
                             args: VirtualDeviceContextArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def VirtualDeviceContext(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             device_id: Optional[float] = None,
                             status: Optional[str] = None,
                             comments: Optional[str] = None,
                             custom_fields: Optional[Mapping[str, str]] = None,
                             description: Optional[str] = None,
                             identifier: Optional[float] = None,
                             name: Optional[str] = None,
                             owner_id: Optional[float] = None,
                             primary_ip4_id: Optional[float] = None,
                             primary_ip6_id: Optional[float] = None,
                             tags: Optional[Sequence[str]] = None,
                             tenant_id: Optional[float] = None)
    func NewVirtualDeviceContext(ctx *Context, name string, args VirtualDeviceContextArgs, opts ...ResourceOption) (*VirtualDeviceContext, error)
    public VirtualDeviceContext(string name, VirtualDeviceContextArgs args, CustomResourceOptions? opts = null)
    public VirtualDeviceContext(String name, VirtualDeviceContextArgs args)
    public VirtualDeviceContext(String name, VirtualDeviceContextArgs args, CustomResourceOptions options)
    
    type: netbox:VirtualDeviceContext
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "netbox_virtual_device_context" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args VirtualDeviceContextArgs
    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 VirtualDeviceContextArgs
    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 VirtualDeviceContextArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VirtualDeviceContextArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VirtualDeviceContextArgs
    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 virtualDeviceContextResource = new Netbox.VirtualDeviceContext("virtualDeviceContextResource", new()
    {
        DeviceId = 0.0,
        Status = "string",
        Comments = "string",
        CustomFields = 
        {
            { "string", "string" },
        },
        Description = "string",
        Identifier = 0.0,
        Name = "string",
        OwnerId = 0.0,
        PrimaryIp4Id = 0.0,
        PrimaryIp6Id = 0.0,
        Tags = new[]
        {
            "string",
        },
        TenantId = 0.0,
    });
    
    example, err := netbox.NewVirtualDeviceContext(ctx, "virtualDeviceContextResource", &netbox.VirtualDeviceContextArgs{
    	DeviceId: pulumi.Float64(0),
    	Status:   pulumi.String("string"),
    	Comments: pulumi.String("string"),
    	CustomFields: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description:  pulumi.String("string"),
    	Identifier:   pulumi.Float64(0),
    	Name:         pulumi.String("string"),
    	OwnerId:      pulumi.Float64(0),
    	PrimaryIp4Id: pulumi.Float64(0),
    	PrimaryIp6Id: pulumi.Float64(0),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TenantId: pulumi.Float64(0),
    })
    
    resource "netbox_virtual_device_context" "virtualDeviceContextResource" {
      lifecycle {
        create_before_destroy = true
      }
      device_id = 0
      status    = "string"
      comments  = "string"
      custom_fields = {
        "string" = "string"
      }
      description    = "string"
      identifier     = 0
      name           = "string"
      owner_id       = 0
      primary_ip4_id = 0
      primary_ip6_id = 0
      tags           = ["string"]
      tenant_id      = 0
    }
    
    var virtualDeviceContextResource = new VirtualDeviceContext("virtualDeviceContextResource", VirtualDeviceContextArgs.builder()
        .deviceId(0.0)
        .status("string")
        .comments("string")
        .customFields(Map.of("string", "string"))
        .description("string")
        .identifier(0.0)
        .name("string")
        .ownerId(0.0)
        .primaryIp4Id(0.0)
        .primaryIp6Id(0.0)
        .tags("string")
        .tenantId(0.0)
        .build());
    
    virtual_device_context_resource = netbox.VirtualDeviceContext("virtualDeviceContextResource",
        device_id=float(0),
        status="string",
        comments="string",
        custom_fields={
            "string": "string",
        },
        description="string",
        identifier=float(0),
        name="string",
        owner_id=float(0),
        primary_ip4_id=float(0),
        primary_ip6_id=float(0),
        tags=["string"],
        tenant_id=float(0))
    
    const virtualDeviceContextResource = new netbox.VirtualDeviceContext("virtualDeviceContextResource", {
        deviceId: 0,
        status: "string",
        comments: "string",
        customFields: {
            string: "string",
        },
        description: "string",
        identifier: 0,
        name: "string",
        ownerId: 0,
        primaryIp4Id: 0,
        primaryIp6Id: 0,
        tags: ["string"],
        tenantId: 0,
    });
    
    type: netbox:VirtualDeviceContext
    properties:
        comments: string
        customFields:
            string: string
        description: string
        deviceId: 0
        identifier: 0
        name: string
        ownerId: 0
        primaryIp4Id: 0
        primaryIp6Id: 0
        status: string
        tags:
            - string
        tenantId: 0
    

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

    DeviceId double
    Id of the device.
    Status string
    Operational status. One of: active, planned, offline.
    Comments string
    CustomFields 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
    Identifier double
    Numeric identifier, unique within the device. Must be a whole number.
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    PrimaryIp4Id double
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    PrimaryIp6Id double
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TenantId double
    Id of the tenant.
    DeviceId float64
    Id of the device.
    Status string
    Operational status. One of: active, planned, offline.
    Comments string
    CustomFields 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
    Identifier float64
    Numeric identifier, unique within the device. Must be a whole number.
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    PrimaryIp4Id float64
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    PrimaryIp6Id float64
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TenantId float64
    Id of the tenant.
    device_id number
    Id of the device.
    status string
    Operational status. One of: active, planned, offline.
    comments 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
    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.
    primary_ip4_id number
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primary_ip6_id number
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    tags list(string)
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenant_id number
    Id of the tenant.
    deviceId Double
    Id of the device.
    status String
    Operational status. One of: active, planned, offline.
    comments String
    customFields 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
    identifier Double
    Numeric identifier, unique within the device. Must be a whole number.
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    primaryIp4Id Double
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primaryIp6Id Double
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenantId Double
    Id of the tenant.
    deviceId number
    Id of the device.
    status string
    Operational status. One of: active, planned, offline.
    comments string
    customFields {[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
    identifier number
    Numeric identifier, unique within the device. Must be a whole number.
    name string
    ownerId number
    Id of the owner the object is assigned to.
    primaryIp4Id number
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primaryIp6Id number
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenantId number
    Id of the tenant.
    device_id float
    Id of the device.
    status str
    Operational status. One of: active, planned, offline.
    comments 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
    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.
    primary_ip4_id float
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primary_ip6_id float
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    tags Sequence[str]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenant_id float
    Id of the tenant.
    deviceId Number
    Id of the device.
    status String
    Operational status. One of: active, planned, offline.
    comments String
    customFields 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
    identifier Number
    Numeric identifier, unique within the device. Must be a whole number.
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    primaryIp4Id Number
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primaryIp6Id Number
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenantId Number
    Id of the tenant.

    Outputs

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

    Created string
    Id string
    The provider-assigned unique ID for this managed resource.
    InterfaceCount double
    Number of interfaces assigned to the context.
    LastUpdated string
    TagsAlls List<string>
    Slugs of all tags on the object, including the provider's default_tags.
    Url string
    VirtualDeviceContextId double
    NetBox id.
    Created string
    Id string
    The provider-assigned unique ID for this managed resource.
    InterfaceCount float64
    Number of interfaces assigned to the context.
    LastUpdated string
    TagsAlls []string
    Slugs of all tags on the object, including the provider's default_tags.
    Url string
    VirtualDeviceContextId float64
    NetBox id.
    created string
    id string
    The provider-assigned unique ID for this managed resource.
    interface_count number
    Number of interfaces assigned to the context.
    last_updated string
    tags_alls list(string)
    Slugs of all tags on the object, including the provider's default_tags.
    url string
    virtual_device_context_id number
    NetBox id.
    created String
    id String
    The provider-assigned unique ID for this managed resource.
    interfaceCount Double
    Number of interfaces assigned to the context.
    lastUpdated String
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    url String
    virtualDeviceContextId Double
    NetBox id.
    created string
    id string
    The provider-assigned unique ID for this managed resource.
    interfaceCount number
    Number of interfaces assigned to the context.
    lastUpdated string
    tagsAlls string[]
    Slugs of all tags on the object, including the provider's default_tags.
    url string
    virtualDeviceContextId number
    NetBox id.
    created str
    id str
    The provider-assigned unique ID for this managed resource.
    interface_count float
    Number of interfaces assigned to the context.
    last_updated str
    tags_alls Sequence[str]
    Slugs of all tags on the object, including the provider's default_tags.
    url str
    virtual_device_context_id float
    NetBox id.
    created String
    id String
    The provider-assigned unique ID for this managed resource.
    interfaceCount Number
    Number of interfaces assigned to the context.
    lastUpdated String
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    url String
    virtualDeviceContextId Number
    NetBox id.

    Look up Existing VirtualDeviceContext Resource

    Get an existing VirtualDeviceContext 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?: VirtualDeviceContextState, opts?: CustomResourceOptions): VirtualDeviceContext
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comments: Optional[str] = None,
            created: Optional[str] = None,
            custom_fields: Optional[Mapping[str, str]] = None,
            description: Optional[str] = None,
            device_id: Optional[float] = None,
            identifier: Optional[float] = None,
            interface_count: Optional[float] = None,
            last_updated: Optional[str] = None,
            name: Optional[str] = None,
            owner_id: Optional[float] = None,
            primary_ip4_id: Optional[float] = None,
            primary_ip6_id: Optional[float] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            tags_alls: Optional[Sequence[str]] = None,
            tenant_id: Optional[float] = None,
            url: Optional[str] = None,
            virtual_device_context_id: Optional[float] = None) -> VirtualDeviceContext
    func GetVirtualDeviceContext(ctx *Context, name string, id IDInput, state *VirtualDeviceContextState, opts ...ResourceOption) (*VirtualDeviceContext, error)
    public static VirtualDeviceContext Get(string name, Input<string> id, VirtualDeviceContextState? state, CustomResourceOptions? opts = null)
    public static VirtualDeviceContext get(String name, Output<String> id, VirtualDeviceContextState state, CustomResourceOptions options)
    resources:  _:    type: netbox:VirtualDeviceContext    get:      id: ${id}
    import {
      to = netbox_virtual_device_context.example
      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:
    Comments string
    Created string
    CustomFields 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
    DeviceId double
    Id of the device.
    Identifier double
    Numeric identifier, unique within the device. Must be a whole number.
    InterfaceCount double
    Number of interfaces assigned to the context.
    LastUpdated string
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    PrimaryIp4Id double
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    PrimaryIp6Id 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.
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls List<string>
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId double
    Id of the tenant.
    Url string
    VirtualDeviceContextId double
    NetBox id.
    Comments string
    Created string
    CustomFields 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
    DeviceId float64
    Id of the device.
    Identifier float64
    Numeric identifier, unique within the device. Must be a whole number.
    InterfaceCount float64
    Number of interfaces assigned to the context.
    LastUpdated string
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    PrimaryIp4Id float64
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    PrimaryIp6Id 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.
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls []string
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId float64
    Id of the tenant.
    Url string
    VirtualDeviceContextId float64
    NetBox id.
    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.
    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_id number
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primary_ip6_id 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.
    tags list(string)
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls list(string)
    Slugs of all tags on the object, including the provider's default_tags.
    tenant_id number
    Id of the tenant.
    url string
    virtual_device_context_id number
    NetBox id.
    comments String
    created String
    customFields 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
    deviceId Double
    Id of the device.
    identifier Double
    Numeric identifier, unique within the device. Must be a whole number.
    interfaceCount Double
    Number of interfaces assigned to the context.
    lastUpdated String
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    primaryIp4Id Double
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primaryIp6Id 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.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Double
    Id of the tenant.
    url String
    virtualDeviceContextId Double
    NetBox id.
    comments string
    created string
    customFields {[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
    deviceId number
    Id of the device.
    identifier number
    Numeric identifier, unique within the device. Must be a whole number.
    interfaceCount number
    Number of interfaces assigned to the context.
    lastUpdated string
    name string
    ownerId number
    Id of the owner the object is assigned to.
    primaryIp4Id number
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primaryIp6Id 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.
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls string[]
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId number
    Id of the tenant.
    url string
    virtualDeviceContextId number
    NetBox id.
    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.
    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_id float
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primary_ip6_id float
    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.
    tags Sequence[str]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls Sequence[str]
    Slugs of all tags on the object, including the provider's default_tags.
    tenant_id float
    Id of the tenant.
    url str
    virtual_device_context_id float
    NetBox id.
    comments String
    created String
    customFields 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
    deviceId Number
    Id of the device.
    identifier Number
    Numeric identifier, unique within the device. Must be a whole number.
    interfaceCount Number
    Number of interfaces assigned to the context.
    lastUpdated String
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    primaryIp4Id Number
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primaryIp6Id 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.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Number
    Id of the tenant.
    url String
    virtualDeviceContextId Number
    NetBox id.

    Import

    In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

    terraform

    import {

    to = netbox_virtual_device_context.test

    id = “123”

    }

    The pulumi import command can be used, for example:

    $ pulumi import netbox:index/virtualDeviceContext:VirtualDeviceContext test 123
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    netbox
    Viewing docs for netbox 6.0.0
    published on Wednesday, Nov 4, 2026 by e-breuninger

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial