1. Packages
  2. Equinix
  3. API Docs
  4. metal
  5. getVlan
Equinix v0.11.2 published on Wednesday, Jun 26, 2024 by Equinix

equinix.metal.getVlan

Explore with Pulumi AI

equinix logo
Equinix v0.11.2 published on Wednesday, Jun 26, 2024 by Equinix

    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

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    Metro string

    Metro where the VLAN is deployed.

    NOTE: You must set either vlan_id or a combination of vxlan, project_id, and, metro or facility.

    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. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    Metro string

    Metro where the VLAN is deployed.

    NOTE: You must set either vlan_id or a combination of vxlan, project_id, and, metro or facility.

    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. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro String

    Metro where the VLAN is deployed.

    NOTE: You must set either vlan_id or a combination of vxlan, project_id, and, metro or facility.

    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. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro string

    Metro where the VLAN is deployed.

    NOTE: You must set either vlan_id or a combination of vxlan, project_id, and, metro or facility.

    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. Deprecated, see https://feedback.equinixmetal.com/changelog/bye-facilities-hello-again-metros

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro str

    Metro where the VLAN is deployed.

    NOTE: You must set either vlan_id or a combination of vxlan, project_id, and, metro or facility.

    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

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro String

    Metro where the VLAN is deployed.

    NOTE: You must set either vlan_id or a combination of vxlan, project_id, and, metro or facility.

    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

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    Id string
    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

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    Id string
    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

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    id String
    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

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    id string
    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

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    id str
    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

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    id String
    metro String
    projectId String
    vlanId 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.
    equinix logo
    Equinix v0.11.2 published on Wednesday, Jun 26, 2024 by Equinix