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:
import * as pulumi from "@pulumi/pulumi";
import * as equinix from "@equinix-labs/pulumi-equinix";
import * as equinix from "@pulumi/equinix";
const foovlan = new equinix.metal.Vlan("foovlan", {
projectId: local.project_id,
metro: "sv",
vxlan: 5,
});
const dsvlan = equinix.metal.getVlanOutput({
vlanId: foovlan.id,
});
import pulumi
import pulumi_equinix as equinix
foovlan = equinix.metal.Vlan("foovlan",
project_id=local["project_id"],
metro="sv",
vxlan=5)
dsvlan = equinix.metal.get_vlan_output(vlan_id=foovlan.id)
package main
import (
"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foovlan, err := metal.NewVlan(ctx, "foovlan", &metal.VlanArgs{
ProjectId: pulumi.Any(local.Project_id),
Metro: pulumi.String("sv"),
Vxlan: pulumi.Int(5),
})
if err != nil {
return err
}
_ = metal.LookupVlanOutput(ctx, metal.GetVlanOutputArgs{
VlanId: foovlan.ID(),
}, nil)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Equinix = Pulumi.Equinix;
return await Deployment.RunAsync(() =>
{
var foovlan = new Equinix.Metal.Vlan("foovlan", new()
{
ProjectId = local.Project_id,
Metro = "sv",
Vxlan = 5,
});
var dsvlan = Equinix.Metal.GetVlan.Invoke(new()
{
VlanId = foovlan.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.equinix.metal.Vlan;
import com.pulumi.equinix.metal.VlanArgs;
import com.pulumi.equinix.metal.MetalFunctions;
import com.pulumi.equinix.metal.inputs.GetVlanArgs;
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 foovlan = new Vlan("foovlan", VlanArgs.builder()
.projectId(local.project_id())
.metro("sv")
.vxlan(5)
.build());
final var dsvlan = MetalFunctions.getVlan(GetVlanArgs.builder()
.vlanId(foovlan.id())
.build());
}
}
resources:
foovlan:
type: equinix:metal:Vlan
properties:
projectId: ${local.project_id}
metro: sv
vxlan: 5
variables:
dsvlan:
fn::invoke:
Function: equinix:metal:getVlan
Arguments:
vlanId: ${foovlan.id}
Fetch a vlan by project ID, vxlan and metro
import * as pulumi from "@pulumi/pulumi";
import * as equinix from "@pulumi/equinix";
const dsvlan = equinix.metal.getVlan({
projectId: local.project_id,
vxlan: 5,
metro: "sv",
});
import pulumi
import pulumi_equinix as equinix
dsvlan = equinix.metal.get_vlan(project_id=local["project_id"],
vxlan=5,
metro="sv")
package main
import (
"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := metal.LookupVlan(ctx, &metal.LookupVlanArgs{
ProjectId: pulumi.StringRef(local.Project_id),
Vxlan: pulumi.IntRef(5),
Metro: pulumi.StringRef("sv"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Equinix = Pulumi.Equinix;
return await Deployment.RunAsync(() =>
{
var dsvlan = Equinix.Metal.GetVlan.Invoke(new()
{
ProjectId = local.Project_id,
Vxlan = 5,
Metro = "sv",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.equinix.metal.MetalFunctions;
import com.pulumi.equinix.metal.inputs.GetVlanArgs;
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) {
final var dsvlan = MetalFunctions.getVlan(GetVlanArgs.builder()
.projectId(local.project_id())
.vxlan(5)
.metro("sv")
.build());
}
}
variables:
dsvlan:
fn::invoke:
Function: equinix:metal:getVlan
Arguments:
projectId: ${local.project_id}
vxlan: 5
metro: sv
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/getVlan:getVlan
arguments:
# arguments dictionary
The following arguments are supported:
- Facility string
- Facility where the VLAN is deployed. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros
- Metro string
Metro where the VLAN is deployed.
NOTE: You must set either
vlan_id
or a combination ofvxlan
,project_id
, and,metro
orfacility
.- Project
Id string - UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility.
- Vlan
Id 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. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros
- Metro string
Metro where the VLAN is deployed.
NOTE: You must set either
vlan_id
or a combination ofvxlan
,project_id
, and,metro
orfacility
.- Project
Id string - UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility.
- Vlan
Id 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. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros
- metro String
Metro where the VLAN is deployed.
NOTE: You must set either
vlan_id
or a combination ofvxlan
,project_id
, and,metro
orfacility
.- project
Id String - UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility.
- vlan
Id 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. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros
- metro string
Metro where the VLAN is deployed.
NOTE: You must set either
vlan_id
or a combination ofvxlan
,project_id
, and,metro
orfacility
.- project
Id string - UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility.
- vlan
Id 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. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros
- metro str
Metro where the VLAN is deployed.
NOTE: You must set either
vlan_id
or a combination ofvxlan
,project_id
, and,metro
orfacility
.- 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. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros
- metro String
Metro where the VLAN is deployed.
NOTE: You must set either
vlan_id
or a combination ofvxlan
,project_id
, and,metro
orfacility
.- project
Id String - UUID of parent project of the VLAN. Use together with the vxlan number and metro or facility.
- vlan
Id 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:
- Assigned
Devices List<string>Ids - List of device ID to which this VLAN is assigned.
- Description string
- Description text of the VLAN resource.
- Facility string
- Id string
- Metro string
- Project
Id string - Vlan
Id string - Vxlan int
- Assigned
Devices []stringIds - List of device ID to which this VLAN is assigned.
- Description string
- Description text of the VLAN resource.
- Facility string
- Id string
- Metro string
- Project
Id string - Vlan
Id string - Vxlan int
- assigned
Devices List<String>Ids - List of device ID to which this VLAN is assigned.
- description String
- Description text of the VLAN resource.
- facility String
- id String
- metro String
- project
Id String - vlan
Id String - vxlan Integer
- assigned
Devices string[]Ids - List of device ID to which this VLAN is assigned.
- description string
- Description text of the VLAN resource.
- facility string
- id string
- metro string
- project
Id string - vlan
Id string - vxlan number
- assigned_
devices_ Sequence[str]ids - List of device ID to which this VLAN is assigned.
- description str
- Description text of the VLAN resource.
- facility str
- id str
- metro str
- project_
id str - vlan_
id str - vxlan int
- assigned
Devices List<String>Ids - List of device ID to which this VLAN is assigned.
- description String
- Description text of the VLAN resource.
- facility String
- id String
- metro String
- project
Id String - vlan
Id String - vxlan Number
Package Details
- Repository
- equinix equinix/pulumi-equinix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
equinix
Terraform Provider.