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,
        ],
    ],
});
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,
        ],
    ])
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
	})
}
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,
            },
        },
    });
});
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());
    }
}
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
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 string
- The unique name of the resource.
- args VlanGroupArgs
- 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 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 string
- The unique name of the resource.
- args VlanGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VlanGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var vlanGroupResource = new VlanGroup("vlanGroupResource", VlanGroupArgs.builder()
    .slug("string")
    .vidRanges(0)
    .description("string")
    .name("string")
    .scopeId(0)
    .scopeType("string")
    .tags("string")
    .vlanGroupId("string")
    .build());
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")
const vlanGroupResource = new netbox.VlanGroup("vlanGroupResource", {
    slug: "string",
    vidRanges: [[0]],
    description: "string",
    name: "string",
    scopeId: 0,
    scopeType: "string",
    tags: ["string"],
    vlanGroupId: "string",
});
type: netbox:VlanGroup
properties:
    description: string
    name: string
    scopeId: 0
    scopeType: string
    slug: string
    tags:
        - string
    vidRanges:
        - - 0
    vlanGroupId: string
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 string
- VidRanges List<ImmutableArray<double>> 
- Description string
- Defaults to "".
- Name string
- ScopeId double
- Required when scope_typeis set.
- ScopeType string
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- List<string>
- VlanGroup stringId 
- The ID of this resource.
- Slug string
- VidRanges [][]float64
- Description string
- Defaults to "".
- Name string
- ScopeId float64
- Required when scope_typeis set.
- ScopeType string
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- []string
- VlanGroup stringId 
- The ID of this resource.
- slug String
- vidRanges List<List<Double>>
- description String
- Defaults to "".
- name String
- scopeId Double
- Required when scope_typeis set.
- scopeType String
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- List<String>
- vlanGroup StringId 
- The ID of this resource.
- slug string
- vidRanges number[][]
- description string
- Defaults to "".
- name string
- scopeId number
- Required when scope_typeis set.
- scopeType string
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- string[]
- vlanGroup stringId 
- The ID of this resource.
- slug str
- vid_ranges Sequence[Sequence[float]]
- description str
- Defaults to "".
- name str
- scope_id float
- Required when scope_typeis set.
- scope_type str
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- Sequence[str]
- vlan_group_ strid 
- The ID of this resource.
- slug String
- vidRanges List<List<Number>>
- description String
- Defaults to "".
- name String
- scopeId Number
- Required when scope_typeis set.
- scopeType String
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- List<String>
- vlanGroup StringId 
- 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) -> VlanGroupfunc 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
- 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
- Defaults to "".
- Name string
- ScopeId double
- Required when scope_typeis set.
- ScopeType string
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- Slug string
- List<string>
- VidRanges List<ImmutableArray<double>> 
- VlanGroup stringId 
- The ID of this resource.
- Description string
- Defaults to "".
- Name string
- ScopeId float64
- Required when scope_typeis set.
- ScopeType string
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- Slug string
- []string
- VidRanges [][]float64
- VlanGroup stringId 
- The ID of this resource.
- description String
- Defaults to "".
- name String
- scopeId Double
- Required when scope_typeis set.
- scopeType String
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- slug String
- List<String>
- vidRanges List<List<Double>>
- vlanGroup StringId 
- The ID of this resource.
- description string
- Defaults to "".
- name string
- scopeId number
- Required when scope_typeis set.
- scopeType string
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- slug string
- string[]
- vidRanges number[][]
- vlanGroup stringId 
- The ID of this resource.
- description str
- Defaults to "".
- name str
- scope_id float
- Required when scope_typeis set.
- scope_type str
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- slug str
- Sequence[str]
- vid_ranges Sequence[Sequence[float]]
- vlan_group_ strid 
- The ID of this resource.
- description String
- Defaults to "".
- name String
- scopeId Number
- Required when scope_typeis set.
- scopeType String
- Valid values are dcim.location,dcim.site,dcim.sitegroup,dcim.region,dcim.rack,virtualization.clusterandvirtualization.clustergroup.
- slug String
- List<String>
- vidRanges List<List<Number>>
- vlanGroup StringId 
- The ID of this resource.
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the netboxTerraform Provider.