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

netbox.VlanGroup

Explore with Pulumi AI

A VLAN Group represents a collection of VLANs. Generally, these are limited by one of a number of scopes such as “Site” or “Virtualization Cluster”.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";

//Basic VLAN Group example
const example1 = new netbox.VlanGroup("example1", {slug: "example1"});
//Full VLAN Group example
const example2 = new netbox.VlanGroup("example2", {
    slug: "example2",
    scopeType: "dcim.site",
    scopeId: netbox_site.example.id,
    description: "Second Example VLAN Group",
    tags: [netbox_tag.example.id],
    vidRanges: [
        [
            1,
            2,
        ],
        [
            3,
            4,
        ],
    ],
});
Copy
import pulumi
import pulumi_netbox as netbox

#Basic VLAN Group example
example1 = netbox.VlanGroup("example1", slug="example1")
#Full VLAN Group example
example2 = netbox.VlanGroup("example2",
    slug="example2",
    scope_type="dcim.site",
    scope_id=netbox_site["example"]["id"],
    description="Second Example VLAN Group",
    tags=[netbox_tag["example"]["id"]],
    vid_ranges=[
        [
            1,
            2,
        ],
        [
            3,
            4,
        ],
    ])
Copy
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 {
		// Basic VLAN Group example
		_, err := netbox.NewVlanGroup(ctx, "example1", &netbox.VlanGroupArgs{
			Slug: pulumi.String("example1"),
		})
		if err != nil {
			return err
		}
		// Full VLAN Group example
		_, err = netbox.NewVlanGroup(ctx, "example2", &netbox.VlanGroupArgs{
			Slug:        pulumi.String("example2"),
			ScopeType:   pulumi.String("dcim.site"),
			ScopeId:     pulumi.Any(netbox_site.Example.Id),
			Description: pulumi.String("Second Example VLAN Group"),
			Tags: pulumi.StringArray{
				netbox_tag.Example.Id,
			},
			VidRanges: pulumi.Float64ArrayArray{
				pulumi.Float64Array{
					pulumi.Float64(1),
					pulumi.Float64(2),
				},
				pulumi.Float64Array{
					pulumi.Float64(3),
					pulumi.Float64(4),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;

return await Deployment.RunAsync(() => 
{
    //Basic VLAN Group example
    var example1 = new Netbox.VlanGroup("example1", new()
    {
        Slug = "example1",
    });

    //Full VLAN Group example
    var example2 = new Netbox.VlanGroup("example2", new()
    {
        Slug = "example2",
        ScopeType = "dcim.site",
        ScopeId = netbox_site.Example.Id,
        Description = "Second Example VLAN Group",
        Tags = new[]
        {
            netbox_tag.Example.Id,
        },
        VidRanges = new[]
        {
            new[]
            {
                1,
                2,
            },
            new[]
            {
                3,
                4,
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.VlanGroup;
import com.pulumi.netbox.VlanGroupArgs;
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) {
        //Basic VLAN Group example
        var example1 = new VlanGroup("example1", VlanGroupArgs.builder()
            .slug("example1")
            .build());

        //Full VLAN Group example
        var example2 = new VlanGroup("example2", VlanGroupArgs.builder()
            .slug("example2")
            .scopeType("dcim.site")
            .scopeId(netbox_site.example().id())
            .description("Second Example VLAN Group")
            .tags(netbox_tag.example().id())
            .vidRanges(            
                                
                    1,
                    2,
                                
                    3,
                    4)
            .build());

    }
}
Copy
resources:
  #Basic VLAN Group example
  example1:
    type: netbox:VlanGroup
    properties:
      slug: example1
  #Full VLAN Group example
  example2:
    type: netbox:VlanGroup
    properties:
      slug: example2
      scopeType: dcim.site
      scopeId: ${netbox_site.example.id}
      description: Second Example VLAN Group
      tags:
        - ${netbox_tag.example.id}
      vidRanges:
        - - 1
          - 2
        - - 3
          - 4
Copy

Create VlanGroup Resource

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

Constructor syntax

new VlanGroup(name: string, args: VlanGroupArgs, opts?: CustomResourceOptions);
@overload
def VlanGroup(resource_name: str,
              args: VlanGroupArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def VlanGroup(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              slug: Optional[str] = None,
              vid_ranges: Optional[Sequence[Sequence[float]]] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              scope_id: Optional[float] = None,
              scope_type: Optional[str] = None,
              tags: Optional[Sequence[str]] = None,
              vlan_group_id: Optional[str] = None)
func NewVlanGroup(ctx *Context, name string, args VlanGroupArgs, opts ...ResourceOption) (*VlanGroup, error)
public VlanGroup(string name, VlanGroupArgs args, CustomResourceOptions? opts = null)
public VlanGroup(String name, VlanGroupArgs args)
public VlanGroup(String name, VlanGroupArgs args, CustomResourceOptions options)
type: netbox:VlanGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VlanGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VlanGroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VlanGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VlanGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VlanGroupArgs
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 vlanGroupResource = new Netbox.VlanGroup("vlanGroupResource", new()
{
    Slug = "string",
    VidRanges = new[]
    {
        new[]
        {
            0,
        },
    },
    Description = "string",
    Name = "string",
    ScopeId = 0,
    ScopeType = "string",
    Tags = new[]
    {
        "string",
    },
    VlanGroupId = "string",
});
Copy
example, err := netbox.NewVlanGroup(ctx, "vlanGroupResource", &netbox.VlanGroupArgs{
Slug: pulumi.String("string"),
VidRanges: pulumi.Float64ArrayArray{
pulumi.Float64Array{
pulumi.Float64(0),
},
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
ScopeId: pulumi.Float64(0),
ScopeType: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
VlanGroupId: pulumi.String("string"),
})
Copy
var vlanGroupResource = new VlanGroup("vlanGroupResource", VlanGroupArgs.builder()
    .slug("string")
    .vidRanges(0)
    .description("string")
    .name("string")
    .scopeId(0)
    .scopeType("string")
    .tags("string")
    .vlanGroupId("string")
    .build());
Copy
vlan_group_resource = netbox.VlanGroup("vlanGroupResource",
    slug="string",
    vid_ranges=[[0]],
    description="string",
    name="string",
    scope_id=0,
    scope_type="string",
    tags=["string"],
    vlan_group_id="string")
Copy
const vlanGroupResource = new netbox.VlanGroup("vlanGroupResource", {
    slug: "string",
    vidRanges: [[0]],
    description: "string",
    name: "string",
    scopeId: 0,
    scopeType: "string",
    tags: ["string"],
    vlanGroupId: "string",
});
Copy
type: netbox:VlanGroup
properties:
    description: string
    name: string
    scopeId: 0
    scopeType: string
    slug: string
    tags:
        - string
    vidRanges:
        - - 0
    vlanGroupId: string
Copy

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

Slug This property is required. string
VidRanges This property is required. List<ImmutableArray<double>>
Description string
Defaults to "".
Name string
ScopeId double
Required when scope_type is set.
ScopeType string
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
Tags List<string>
VlanGroupId string
The ID of this resource.
Slug This property is required. string
VidRanges This property is required. [][]float64
Description string
Defaults to "".
Name string
ScopeId float64
Required when scope_type is set.
ScopeType string
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
Tags []string
VlanGroupId string
The ID of this resource.
slug This property is required. String
vidRanges This property is required. List<List<Double>>
description String
Defaults to "".
name String
scopeId Double
Required when scope_type is set.
scopeType String
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
tags List<String>
vlanGroupId String
The ID of this resource.
slug This property is required. string
vidRanges This property is required. number[][]
description string
Defaults to "".
name string
scopeId number
Required when scope_type is set.
scopeType string
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
tags string[]
vlanGroupId string
The ID of this resource.
slug This property is required. str
vid_ranges This property is required. Sequence[Sequence[float]]
description str
Defaults to "".
name str
scope_id float
Required when scope_type is set.
scope_type str
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
tags Sequence[str]
vlan_group_id str
The ID of this resource.
slug This property is required. String
vidRanges This property is required. List<List<Number>>
description String
Defaults to "".
name String
scopeId Number
Required when scope_type is set.
scopeType String
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
tags List<String>
vlanGroupId String
The ID of this resource.

Outputs

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

Get an existing VlanGroup 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?: VlanGroupState, opts?: CustomResourceOptions): VlanGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        scope_id: Optional[float] = None,
        scope_type: Optional[str] = None,
        slug: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        vid_ranges: Optional[Sequence[Sequence[float]]] = None,
        vlan_group_id: Optional[str] = None) -> VlanGroup
func GetVlanGroup(ctx *Context, name string, id IDInput, state *VlanGroupState, opts ...ResourceOption) (*VlanGroup, error)
public static VlanGroup Get(string name, Input<string> id, VlanGroupState? state, CustomResourceOptions? opts = null)
public static VlanGroup get(String name, Output<String> id, VlanGroupState state, CustomResourceOptions options)
resources:  _:    type: netbox:VlanGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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
Defaults to "".
Name string
ScopeId double
Required when scope_type is set.
ScopeType string
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
Slug string
Tags List<string>
VidRanges List<ImmutableArray<double>>
VlanGroupId string
The ID of this resource.
Description string
Defaults to "".
Name string
ScopeId float64
Required when scope_type is set.
ScopeType string
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
Slug string
Tags []string
VidRanges [][]float64
VlanGroupId string
The ID of this resource.
description String
Defaults to "".
name String
scopeId Double
Required when scope_type is set.
scopeType String
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
slug String
tags List<String>
vidRanges List<List<Double>>
vlanGroupId String
The ID of this resource.
description string
Defaults to "".
name string
scopeId number
Required when scope_type is set.
scopeType string
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
slug string
tags string[]
vidRanges number[][]
vlanGroupId string
The ID of this resource.
description str
Defaults to "".
name str
scope_id float
Required when scope_type is set.
scope_type str
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
slug str
tags Sequence[str]
vid_ranges Sequence[Sequence[float]]
vlan_group_id str
The ID of this resource.
description String
Defaults to "".
name String
scopeId Number
Required when scope_type is set.
scopeType String
Valid values are dcim.location, dcim.site, dcim.sitegroup, dcim.region, dcim.rack, virtualization.cluster and virtualization.clustergroup.
slug String
tags List<String>
vidRanges List<List<Number>>
vlanGroupId String
The ID of this resource.

Package Details

Repository
netbox e-breuninger/terraform-provider-netbox
License
Notes
This Pulumi package is based on the netbox Terraform Provider.