equinix-metal logo
Equinix Metal v3.2.1, Dec 30 21

equinix-metal.getVlan

Explore with Pulumi AI

Provides an Equinix Metal Virtual Network datasource. VLANs data sources can be searched by VLAN UUID, or project UUID and vxlan number.

Example Usage

Fetch a vlan by ID

using Pulumi;
using EquinixMetal = Pulumi.EquinixMetal;

class MyStack : Stack
{
    public MyStack()
    {
        var foovlan = new EquinixMetal.Vlan("foovlan", new EquinixMetal.VlanArgs
        {
            ProjectId = local.Project_id,
            Metro = "sv",
            Vxlan = 5,
        });
        var dsvlan = foovlan.Id.Apply(id => EquinixMetal.GetVlan.InvokeAsync(new EquinixMetal.GetVlanArgs
        {
            VlanId = id,
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-equinix-metal/sdk/v3/go/equinix-metal"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		foovlan, err := equinix - metal.NewVlan(ctx, "foovlan", &equinix-metal.VlanArgs{
			ProjectId: pulumi.Any(local.Project_id),
			Metro:     pulumi.String("sv"),
			Vxlan:     pulumi.Int(5),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_equinix_metal as equinix_metal

foovlan = equinix_metal.Vlan("foovlan",
    project_id=local["project_id"],
    metro="sv",
    vxlan=5)
dsvlan = foovlan.id.apply(lambda id: equinix_metal.get_vlan(vlan_id=id))
import * as pulumi from "@pulumi/pulumi";
import * as equinix_metal from "@pulumi/equinix-metal";

const foovlan = new equinix_metal.Vlan("foovlan", {
    projectId: local.project_id,
    metro: "sv",
    vxlan: 5,
});
const dsvlan = foovlan.id.apply(id => equinix_metal.getVlan({
    vlanId: id,
}));

Coming soon!

Fetch a vlan by project ID, vxlan and metro

using Pulumi;
using EquinixMetal = Pulumi.EquinixMetal;

class MyStack : Stack
{
    public MyStack()
    {
        var foovlan = new EquinixMetal.Vlan("foovlan", new EquinixMetal.VlanArgs
        {
            ProjectId = local.Project_id,
            Metro = "sv",
            Vxlan = 5,
        });
        var dsvlan = Output.Create(EquinixMetal.GetVlan.InvokeAsync(new EquinixMetal.GetVlanArgs
        {
            ProjectId = local.Project_id,
            Vxlan = 5,
            Metro = "sv",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-equinix-metal/sdk/v3/go/equinix-metal"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := equinix - metal.NewVlan(ctx, "foovlan", &equinix-metal.VlanArgs{
			ProjectId: pulumi.Any(local.Project_id),
			Metro:     pulumi.String("sv"),
			Vxlan:     pulumi.Int(5),
		})
		if err != nil {
			return err
		}
		opt0 := local.Project_id
		opt1 := 5
		opt2 := "sv"
		_, err = equinix - metal.LookupVlan(ctx, &GetVlanArgs{
			ProjectId: &opt0,
			Vxlan:     &opt1,
			Metro:     &opt2,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_equinix_metal as equinix_metal

foovlan = equinix_metal.Vlan("foovlan",
    project_id=local["project_id"],
    metro="sv",
    vxlan=5)
dsvlan = equinix_metal.get_vlan(project_id=local["project_id"],
    vxlan=5,
    metro="sv")
import * as pulumi from "@pulumi/pulumi";
import * as equinix_metal from "@pulumi/equinix-metal";

const foovlan = new equinix_metal.Vlan("foovlan", {
    projectId: local.project_id,
    metro: "sv",
    vxlan: 5,
});
const dsvlan = equinix_metal.getVlan({
    projectId: local.project_id,
    vxlan: 5,
    metro: "sv",
});

Coming soon!

Using getVlan

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 getVlan(args: GetVlanArgs, opts?: InvokeOptions): Promise<GetVlanResult>
function getVlanOutput(args: GetVlanOutputArgs, opts?: InvokeOptions): Output<GetVlanResult>
def get_vlan(facility: Optional[str] = None,
             metro: Optional[str] = None,
             project_id: Optional[str] = None,
             vlan_id: Optional[str] = None,
             vxlan: Optional[int] = None,
             opts: Optional[InvokeOptions] = None) -> GetVlanResult
def get_vlan_output(facility: Optional[pulumi.Input[str]] = None,
             metro: Optional[pulumi.Input[str]] = None,
             project_id: Optional[pulumi.Input[str]] = None,
             vlan_id: Optional[pulumi.Input[str]] = None,
             vxlan: Optional[pulumi.Input[int]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetVlanResult]
func LookupVlan(ctx *Context, args *LookupVlanArgs, opts ...InvokeOption) (*LookupVlanResult, error)
func LookupVlanOutput(ctx *Context, args *LookupVlanOutputArgs, opts ...InvokeOption) LookupVlanResultOutput

> Note: This function is named LookupVlan in the Go SDK.

public static class GetVlan 
{
    public static Task<GetVlanResult> InvokeAsync(GetVlanArgs args, InvokeOptions? opts = null)
    public static Output<GetVlanResult> Invoke(GetVlanInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVlanResult> getVlan(GetVlanArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: equinix-metal:index/getVlan:getVlan
  arguments:
    # arguments dictionary

The following arguments are supported:

Facility string

Facility where the VLAN is deployed

Metro string

Metro where the VLAN is deployed

ProjectId string

UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility

VlanId string

Metal UUID of the VLAN resource to look up

Vxlan int

vxlan number of the VLAN to look up. Use together with the project_id and metro or facility

Facility string

Facility where the VLAN is deployed

Metro string

Metro where the VLAN is deployed

ProjectId string

UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility

VlanId string

Metal UUID of the VLAN resource to look up

Vxlan int

vxlan number of the VLAN to look up. Use together with the project_id and metro or facility

facility String

Facility where the VLAN is deployed

metro String

Metro where the VLAN is deployed

projectId String

UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility

vlanId String

Metal UUID of the VLAN resource to look up

vxlan Integer

vxlan number of the VLAN to look up. Use together with the project_id and metro or facility

facility string

Facility where the VLAN is deployed

metro string

Metro where the VLAN is deployed

projectId string

UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility

vlanId string

Metal UUID of the VLAN resource to look up

vxlan number

vxlan number of the VLAN to look up. Use together with the project_id and metro or facility

facility str

Facility where the VLAN is deployed

metro str

Metro where the VLAN is deployed

project_id str

UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility

vlan_id str

Metal UUID of the VLAN resource to look up

vxlan int

vxlan number of the VLAN to look up. Use together with the project_id and metro or facility

facility String

Facility where the VLAN is deployed

metro String

Metro where the VLAN is deployed

projectId String

UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility

vlanId String

Metal UUID of the VLAN resource to look up

vxlan Number

vxlan number of the VLAN to look up. Use together with the project_id and metro or facility

getVlan Result

The following output properties are available:

AssignedDevicesIds List<string>

List of device ID to which this VLAN is assigned

Description string

Description text of the VLAN resource

Facility string
Id string

The provider-assigned unique ID for this managed resource.

Metro string
ProjectId string
VlanId string
Vxlan int
AssignedDevicesIds []string

List of device ID to which this VLAN is assigned

Description string

Description text of the VLAN resource

Facility string
Id string

The provider-assigned unique ID for this managed resource.

Metro string
ProjectId string
VlanId string
Vxlan int
assignedDevicesIds List<String>

List of device ID to which this VLAN is assigned

description String

Description text of the VLAN resource

facility String
id String

The provider-assigned unique ID for this managed resource.

metro String
projectId String
vlanId String
vxlan Integer
assignedDevicesIds string[]

List of device ID to which this VLAN is assigned

description string

Description text of the VLAN resource

facility string
id string

The provider-assigned unique ID for this managed resource.

metro string
projectId string
vlanId string
vxlan number
assigned_devices_ids Sequence[str]

List of device ID to which this VLAN is assigned

description str

Description text of the VLAN resource

facility str
id str

The provider-assigned unique ID for this managed resource.

metro str
project_id str
vlan_id str
vxlan int
assignedDevicesIds List<String>

List of device ID to which this VLAN is assigned

description String

Description text of the VLAN resource

facility String
id String

The provider-assigned unique ID for this managed resource.

metro String
projectId String
vlanId String
vxlan Number

Package Details

Repository
Equinix Metal pulumi/pulumi-equinix-metal
License
Apache-2.0
Notes

This Pulumi package is based on the metal Terraform Provider.