Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Vlan

Provides a resource to allow users to manage Virtual Networks in their projects.

To learn more about Layer 2 networking in Packet, refer to * https://www.packet.com/resources/guides/layer-2-configurations/ * https://www.packet.com/developers/docs/network/advanced/layer-2/

Example Usage

using Pulumi;
using Packet = Pulumi.Packet;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new VLAN in datacenter "ewr1"
        var vlan1 = new Packet.Vlan("vlan1", new Packet.VlanArgs
        {
            Description = "VLAN in New Jersey",
            Facility = "ewr1",
            ProjectId = local.Project_id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-packet/sdk/v3/go/packet"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := packet.NewVlan(ctx, "vlan1", &packet.VlanArgs{
            Description: pulumi.String("VLAN in New Jersey"),
            Facility:    pulumi.String("ewr1"),
            ProjectId:   pulumi.Any(local.Project_id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_packet as packet

# Create a new VLAN in datacenter "ewr1"
vlan1 = packet.Vlan("vlan1",
    description="VLAN in New Jersey",
    facility="ewr1",
    project_id=local["project_id"])
import * as pulumi from "@pulumi/pulumi";
import * as packet from "@pulumi/packet";

// Create a new VLAN in datacenter "ewr1"
const vlan1 = new packet.Vlan("vlan1", {
    description: "VLAN in New Jersey",
    facility: "ewr1",
    projectId: local.project_id,
});

Create a Vlan Resource

new Vlan(name: string, args: VlanArgs, opts?: CustomResourceOptions);
def Vlan(resource_name: str, opts: Optional[ResourceOptions] = None, description: Optional[str] = None, facility: Optional[str] = None, project_id: Optional[str] = None)
func NewVlan(ctx *Context, name string, args VlanArgs, opts ...ResourceOption) (*Vlan, error)
public Vlan(string name, VlanArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args VlanArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VlanArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VlanArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Vlan Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Vlan resource accepts the following input properties:

Facility string

Facility where to create the VLAN

ProjectId string

ID of parent project

Description string

Description string

Facility string

Facility where to create the VLAN

ProjectId string

ID of parent project

Description string

Description string

facility Facility

Facility where to create the VLAN

projectId string

ID of parent project

description string

Description string

facility str

Facility where to create the VLAN

project_id str

ID of parent project

description str

Description string

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Vxlan int

VXLAN segment ID

Id string
The provider-assigned unique ID for this managed resource.
Vxlan int

VXLAN segment ID

id string
The provider-assigned unique ID for this managed resource.
vxlan number

VXLAN segment ID

id str
The provider-assigned unique ID for this managed resource.
vxlan int

VXLAN segment ID

Look up an Existing Vlan Resource

Get an existing Vlan 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?: VlanState, opts?: CustomResourceOptions): Vlan
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, description: Optional[str] = None, facility: Optional[str] = None, project_id: Optional[str] = None, vxlan: Optional[int] = None) -> Vlan
func GetVlan(ctx *Context, name string, id IDInput, state *VlanState, opts ...ResourceOption) (*Vlan, error)
public static Vlan Get(string name, Input<string> id, VlanState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Description string

Description string

Facility string

Facility where to create the VLAN

ProjectId string

ID of parent project

Vxlan int

VXLAN segment ID

Description string

Description string

Facility string

Facility where to create the VLAN

ProjectId string

ID of parent project

Vxlan int

VXLAN segment ID

description string

Description string

facility Facility

Facility where to create the VLAN

projectId string

ID of parent project

vxlan number

VXLAN segment ID

description str

Description string

facility str

Facility where to create the VLAN

project_id str

ID of parent project

vxlan int

VXLAN segment ID

Package Details

Repository
https://github.com/pulumi/pulumi-packet
License
Apache-2.0
Notes
This Pulumi package is based on the packet Terraform Provider.