1. Packages
  2. Packages
  3. Equinix
  4. API Docs
  5. metal
  6. getMetro
Viewing docs for Equinix v0.30.0
published on Thursday, May 14, 2026 by Equinix
equinix logo
Viewing docs for Equinix v0.30.0
published on Thursday, May 14, 2026 by Equinix

    Deprecation Notice Equinix Metal will reach end of life on June 30, 2026. All Metal data sources will be removed in version 5.0.0 of this provider. Use version 4.x of this provider for continued use through sunset. See https://docs.equinix.com/metal/ for more information.

    Provides an Equinix Metal metro datasource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as equinix from "@pulumi/equinix";
    
    const sv = equinix.metal.getMetro({
        code: "sv",
    });
    export const id = sv.then(sv => sv.id);
    
    import pulumi
    import pulumi_equinix as equinix
    
    sv = equinix.metal.get_metro(code="sv")
    pulumi.export("id", sv.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 {
    		sv, err := metal.GetMetro(ctx, &metal.GetMetroArgs{
    			Code: "sv",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", sv.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Equinix = Pulumi.Equinix;
    
    return await Deployment.RunAsync(() => 
    {
        var sv = Equinix.Metal.GetMetro.Invoke(new()
        {
            Code = "sv",
        });
    
        return new Dictionary<string, object?>
        {
            ["id"] = sv.Apply(getMetroResult => getMetroResult.Id),
        };
    });
    
    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.GetMetroArgs;
    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 sv = MetalFunctions.getMetro(GetMetroArgs.builder()
                .code("sv")
                .build());
    
            ctx.export("id", sv.applyValue(getMetroResult -> getMetroResult.id()));
        }
    }
    
    variables:
      sv:
        fn::invoke:
          function: equinix:metal:getMetro
          arguments:
            code: sv
    outputs:
      id: ${sv.id}
    
    Example coming soon!
    

    Using getMetro

    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 getMetro(args: GetMetroArgs, opts?: InvokeOptions): Promise<GetMetroResult>
    function getMetroOutput(args: GetMetroOutputArgs, opts?: InvokeOptions): Output<GetMetroResult>
    def get_metro(capacities: Optional[Sequence[GetMetroCapacity]] = None,
                  code: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetMetroResult
    def get_metro_output(capacities: pulumi.Input[Optional[Sequence[pulumi.Input[GetMetroCapacityArgs]]]] = None,
                  code: pulumi.Input[Optional[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetMetroResult]
    func GetMetro(ctx *Context, args *GetMetroArgs, opts ...InvokeOption) (*GetMetroResult, error)
    func GetMetroOutput(ctx *Context, args *GetMetroOutputArgs, opts ...InvokeOption) GetMetroResultOutput

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

    public static class GetMetro 
    {
        public static Task<GetMetroResult> InvokeAsync(GetMetroArgs args, InvokeOptions? opts = null)
        public static Output<GetMetroResult> Invoke(GetMetroInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMetroResult> getMetro(GetMetroArgs args, InvokeOptions options)
    public static Output<GetMetroResult> getMetro(GetMetroArgs args, InvokeOptions options)
    
    fn::invoke:
      function: equinix:metal/getMetro:getMetro
      arguments:
        # arguments dictionary
    data "equinix_metal_getmetro" "name" {
        # arguments
    }

    The following arguments are supported:

    Code string
    The metro code to search for.
    Capacities List<GetMetroCapacity>
    One or more device plans for which the metro must have capacity.
    Code string
    The metro code to search for.
    Capacities []GetMetroCapacity
    One or more device plans for which the metro must have capacity.
    code string
    The metro code to search for.
    capacities list(object)
    One or more device plans for which the metro must have capacity.
    code String
    The metro code to search for.
    capacities List<GetMetroCapacity>
    One or more device plans for which the metro must have capacity.
    code string
    The metro code to search for.
    capacities GetMetroCapacity[]
    One or more device plans for which the metro must have capacity.
    code str
    The metro code to search for.
    capacities Sequence[GetMetroCapacity]
    One or more device plans for which the metro must have capacity.
    code String
    The metro code to search for.
    capacities List<Property Map>
    One or more device plans for which the metro must have capacity.

    getMetro Result

    The following output properties are available:

    Code string
    Country string
    The country of the metro.
    Id string
    The ID of the metro.
    Name string
    The name of the metro.
    Capacities List<GetMetroCapacity>
    Code string
    Country string
    The country of the metro.
    Id string
    The ID of the metro.
    Name string
    The name of the metro.
    Capacities []GetMetroCapacity
    code string
    country string
    The country of the metro.
    id string
    The ID of the metro.
    name string
    The name of the metro.
    capacities list(object)
    code String
    country String
    The country of the metro.
    id String
    The ID of the metro.
    name String
    The name of the metro.
    capacities List<GetMetroCapacity>
    code string
    country string
    The country of the metro.
    id string
    The ID of the metro.
    name string
    The name of the metro.
    capacities GetMetroCapacity[]
    code str
    country str
    The country of the metro.
    id str
    The ID of the metro.
    name str
    The name of the metro.
    capacities Sequence[GetMetroCapacity]
    code String
    country String
    The country of the metro.
    id String
    The ID of the metro.
    name String
    The name of the metro.
    capacities List<Property Map>

    Supporting Types

    GetMetroCapacity

    Plan string
    Device plan that must be available in selected location.
    Quantity int
    Minimum number of devices that must be available in selected location. Default is 1.
    Plan string
    Device plan that must be available in selected location.
    Quantity int
    Minimum number of devices that must be available in selected location. Default is 1.
    plan string
    Device plan that must be available in selected location.
    quantity number
    Minimum number of devices that must be available in selected location. Default is 1.
    plan String
    Device plan that must be available in selected location.
    quantity Integer
    Minimum number of devices that must be available in selected location. Default is 1.
    plan string
    Device plan that must be available in selected location.
    quantity number
    Minimum number of devices that must be available in selected location. Default is 1.
    plan str
    Device plan that must be available in selected location.
    quantity int
    Minimum number of devices that must be available in selected location. Default is 1.
    plan String
    Device plan that must be available in selected location.
    quantity Number
    Minimum number of devices that must be available in selected location. Default is 1.

    Package Details

    Repository
    equinix equinix/pulumi-equinix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the equinix Terraform Provider.
    equinix logo
    Viewing docs for Equinix v0.30.0
    published on Thursday, May 14, 2026 by Equinix

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial