1. Packages
  2. Equinix
  3. API Docs
  4. fabric
  5. getMetro
Equinix v0.21.0 published on Friday, Feb 28, 2025 by Equinix

equinix.fabric.getMetro

Explore with Pulumi AI

Equinix v0.21.0 published on Friday, Feb 28, 2025 by Equinix

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as equinix from "@pulumi/equinix";

const metro = equinix.fabric.getMetro({
    metroCode: "<metro_code>",
});
export const id = metro.then(metro => metro.id);
export const type = metro.then(metro => metro.type);
export const metroCode = metro.then(metro => metro.metroCode);
export const region = metro.then(metro => metro.region);
export const name = metro.then(metro => metro.name);
export const equinixAsn = metro.then(metro => metro.equinixAsn);
export const localVcBandwidthMax = metro.then(metro => metro.localVcBandwidthMax);
export const geoCoordinates = metro.then(metro => metro.geoCoordinates);
export const connectedMetros = metro.then(metro => metro.connectedMetros);
export const geoScopes = metro.then(metro => metro.geoScopes);
Copy
import pulumi
import pulumi_equinix as equinix

metro = equinix.fabric.get_metro(metro_code="<metro_code>")
pulumi.export("id", metro.id)
pulumi.export("type", metro.type)
pulumi.export("metroCode", metro.metro_code)
pulumi.export("region", metro.region)
pulumi.export("name", metro.name)
pulumi.export("equinixAsn", metro.equinix_asn)
pulumi.export("localVcBandwidthMax", metro.local_vc_bandwidth_max)
pulumi.export("geoCoordinates", metro.geo_coordinates)
pulumi.export("connectedMetros", metro.connected_metros)
pulumi.export("geoScopes", metro.geo_scopes)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		metro, err := fabric.GetMetro(ctx, &fabric.GetMetroArgs{
			MetroCode: "<metro_code>",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", metro.Id)
		ctx.Export("type", metro.Type)
		ctx.Export("metroCode", metro.MetroCode)
		ctx.Export("region", metro.Region)
		ctx.Export("name", metro.Name)
		ctx.Export("equinixAsn", metro.EquinixAsn)
		ctx.Export("localVcBandwidthMax", metro.LocalVcBandwidthMax)
		ctx.Export("geoCoordinates", metro.GeoCoordinates)
		ctx.Export("connectedMetros", metro.ConnectedMetros)
		ctx.Export("geoScopes", metro.GeoScopes)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Equinix = Pulumi.Equinix;

return await Deployment.RunAsync(() => 
{
    var metro = Equinix.Fabric.GetMetro.Invoke(new()
    {
        MetroCode = "<metro_code>",
    });

    return new Dictionary<string, object?>
    {
        ["id"] = metro.Apply(getMetroResult => getMetroResult.Id),
        ["type"] = metro.Apply(getMetroResult => getMetroResult.Type),
        ["metroCode"] = metro.Apply(getMetroResult => getMetroResult.MetroCode),
        ["region"] = metro.Apply(getMetroResult => getMetroResult.Region),
        ["name"] = metro.Apply(getMetroResult => getMetroResult.Name),
        ["equinixAsn"] = metro.Apply(getMetroResult => getMetroResult.EquinixAsn),
        ["localVcBandwidthMax"] = metro.Apply(getMetroResult => getMetroResult.LocalVcBandwidthMax),
        ["geoCoordinates"] = metro.Apply(getMetroResult => getMetroResult.GeoCoordinates),
        ["connectedMetros"] = metro.Apply(getMetroResult => getMetroResult.ConnectedMetros),
        ["geoScopes"] = metro.Apply(getMetroResult => getMetroResult.GeoScopes),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.equinix.fabric.FabricFunctions;
import com.pulumi.equinix.fabric.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 metro = FabricFunctions.getMetro(GetMetroArgs.builder()
            .metroCode("<metro_code>")
            .build());

        ctx.export("id", metro.applyValue(getMetroResult -> getMetroResult.id()));
        ctx.export("type", metro.applyValue(getMetroResult -> getMetroResult.type()));
        ctx.export("metroCode", metro.applyValue(getMetroResult -> getMetroResult.metroCode()));
        ctx.export("region", metro.applyValue(getMetroResult -> getMetroResult.region()));
        ctx.export("name", metro.applyValue(getMetroResult -> getMetroResult.name()));
        ctx.export("equinixAsn", metro.applyValue(getMetroResult -> getMetroResult.equinixAsn()));
        ctx.export("localVcBandwidthMax", metro.applyValue(getMetroResult -> getMetroResult.localVcBandwidthMax()));
        ctx.export("geoCoordinates", metro.applyValue(getMetroResult -> getMetroResult.geoCoordinates()));
        ctx.export("connectedMetros", metro.applyValue(getMetroResult -> getMetroResult.connectedMetros()));
        ctx.export("geoScopes", metro.applyValue(getMetroResult -> getMetroResult.geoScopes()));
    }
}
Copy
variables:
  metro:
    fn::invoke:
      Function: equinix:fabric:getMetro
      Arguments:
        metroCode: <metro_code>
outputs:
  id: ${metro.id}
  type: ${metro.type}
  metroCode: ${metro.metroCode}
  region: ${metro.region}
  name: ${metro.name}
  equinixAsn: ${metro.equinixAsn}
  localVcBandwidthMax: ${metro.localVcBandwidthMax}
  geoCoordinates: ${metro.geoCoordinates}
  connectedMetros: ${metro.connectedMetros}
  geoScopes: ${metro.geoScopes}
Copy

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>
Copy
def get_metro(metro_code: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetMetroResult
def get_metro_output(metro_code: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetMetroResult]
Copy
func GetMetro(ctx *Context, args *GetMetroArgs, opts ...InvokeOption) (*GetMetroResult, error)
func GetMetroOutput(ctx *Context, args *GetMetroOutputArgs, opts ...InvokeOption) GetMetroResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetMetroResult> getMetro(GetMetroArgs args, InvokeOptions options)
public static Output<GetMetroResult> getMetro(GetMetroArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: equinix:fabric/getMetro:getMetro
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

MetroCode This property is required. string
The metro code this data source should retrieve
MetroCode This property is required. string
The metro code this data source should retrieve
metroCode This property is required. String
The metro code this data source should retrieve
metroCode This property is required. string
The metro code this data source should retrieve
metro_code This property is required. str
The metro code this data source should retrieve
metroCode This property is required. String
The metro code this data source should retrieve

getMetro Result

The following output properties are available:

Code string
Code assigned to an Equinix IBX data center in a specified metropolitan area
ConnectedMetros List<GetMetroConnectedMetro>
Arrays of objects containing latency data for the specified metro
EquinixAsn int
Autonomous system number (ASN) for a specified Fabric metro. The ASN is a unique identifier that carries the network routing protocol and exchanges that data with other internal systems via border gateway protocol.
GeoCoordinates GetMetroGeoCoordinates
Geographic location data of Fabric Metro
GeoScopes List<string>
List of supported geographic boundaries of a Fabric Metro. Example values: CANADA, CONUS.
Href string
The canonical URL at which the resource resides
Id string
The unique identifier of the resource
LocalVcBandwidthMax int
This field holds Max Connection speed within the metro.
MetroCode string
The metro code this data source should retrieve
Name string
Name of the region in which the data center is located
Region string
Board geographical area in which the data center is located
Type string
Indicator of a fabric metro
Code string
Code assigned to an Equinix IBX data center in a specified metropolitan area
ConnectedMetros []GetMetroConnectedMetro
Arrays of objects containing latency data for the specified metro
EquinixAsn int
Autonomous system number (ASN) for a specified Fabric metro. The ASN is a unique identifier that carries the network routing protocol and exchanges that data with other internal systems via border gateway protocol.
GeoCoordinates GetMetroGeoCoordinates
Geographic location data of Fabric Metro
GeoScopes []string
List of supported geographic boundaries of a Fabric Metro. Example values: CANADA, CONUS.
Href string
The canonical URL at which the resource resides
Id string
The unique identifier of the resource
LocalVcBandwidthMax int
This field holds Max Connection speed within the metro.
MetroCode string
The metro code this data source should retrieve
Name string
Name of the region in which the data center is located
Region string
Board geographical area in which the data center is located
Type string
Indicator of a fabric metro
code String
Code assigned to an Equinix IBX data center in a specified metropolitan area
connectedMetros List<GetMetroConnectedMetro>
Arrays of objects containing latency data for the specified metro
equinixAsn Integer
Autonomous system number (ASN) for a specified Fabric metro. The ASN is a unique identifier that carries the network routing protocol and exchanges that data with other internal systems via border gateway protocol.
geoCoordinates GetMetroGeoCoordinates
Geographic location data of Fabric Metro
geoScopes List<String>
List of supported geographic boundaries of a Fabric Metro. Example values: CANADA, CONUS.
href String
The canonical URL at which the resource resides
id String
The unique identifier of the resource
localVcBandwidthMax Integer
This field holds Max Connection speed within the metro.
metroCode String
The metro code this data source should retrieve
name String
Name of the region in which the data center is located
region String
Board geographical area in which the data center is located
type String
Indicator of a fabric metro
code string
Code assigned to an Equinix IBX data center in a specified metropolitan area
connectedMetros GetMetroConnectedMetro[]
Arrays of objects containing latency data for the specified metro
equinixAsn number
Autonomous system number (ASN) for a specified Fabric metro. The ASN is a unique identifier that carries the network routing protocol and exchanges that data with other internal systems via border gateway protocol.
geoCoordinates GetMetroGeoCoordinates
Geographic location data of Fabric Metro
geoScopes string[]
List of supported geographic boundaries of a Fabric Metro. Example values: CANADA, CONUS.
href string
The canonical URL at which the resource resides
id string
The unique identifier of the resource
localVcBandwidthMax number
This field holds Max Connection speed within the metro.
metroCode string
The metro code this data source should retrieve
name string
Name of the region in which the data center is located
region string
Board geographical area in which the data center is located
type string
Indicator of a fabric metro
code str
Code assigned to an Equinix IBX data center in a specified metropolitan area
connected_metros Sequence[GetMetroConnectedMetro]
Arrays of objects containing latency data for the specified metro
equinix_asn int
Autonomous system number (ASN) for a specified Fabric metro. The ASN is a unique identifier that carries the network routing protocol and exchanges that data with other internal systems via border gateway protocol.
geo_coordinates GetMetroGeoCoordinates
Geographic location data of Fabric Metro
geo_scopes Sequence[str]
List of supported geographic boundaries of a Fabric Metro. Example values: CANADA, CONUS.
href str
The canonical URL at which the resource resides
id str
The unique identifier of the resource
local_vc_bandwidth_max int
This field holds Max Connection speed within the metro.
metro_code str
The metro code this data source should retrieve
name str
Name of the region in which the data center is located
region str
Board geographical area in which the data center is located
type str
Indicator of a fabric metro
code String
Code assigned to an Equinix IBX data center in a specified metropolitan area
connectedMetros List<Property Map>
Arrays of objects containing latency data for the specified metro
equinixAsn Number
Autonomous system number (ASN) for a specified Fabric metro. The ASN is a unique identifier that carries the network routing protocol and exchanges that data with other internal systems via border gateway protocol.
geoCoordinates Property Map
Geographic location data of Fabric Metro
geoScopes List<String>
List of supported geographic boundaries of a Fabric Metro. Example values: CANADA, CONUS.
href String
The canonical URL at which the resource resides
id String
The unique identifier of the resource
localVcBandwidthMax Number
This field holds Max Connection speed within the metro.
metroCode String
The metro code this data source should retrieve
name String
Name of the region in which the data center is located
region String
Board geographical area in which the data center is located
type String
Indicator of a fabric metro

Supporting Types

GetMetroConnectedMetro

AvgLatency This property is required. double
Code This property is required. string
Href This property is required. string
RemoteVcBandwidthMax This property is required. int
AvgLatency This property is required. float64
Code This property is required. string
Href This property is required. string
RemoteVcBandwidthMax This property is required. int
avgLatency This property is required. Double
code This property is required. String
href This property is required. String
remoteVcBandwidthMax This property is required. Integer
avgLatency This property is required. number
code This property is required. string
href This property is required. string
remoteVcBandwidthMax This property is required. number
avg_latency This property is required. float
code This property is required. str
href This property is required. str
remote_vc_bandwidth_max This property is required. int
avgLatency This property is required. Number
code This property is required. String
href This property is required. String
remoteVcBandwidthMax This property is required. Number

GetMetroGeoCoordinates

Latitude This property is required. double
Latitude of the Metro
Longitude This property is required. double
Longitude of the Metro
Latitude This property is required. float64
Latitude of the Metro
Longitude This property is required. float64
Longitude of the Metro
latitude This property is required. Double
Latitude of the Metro
longitude This property is required. Double
Longitude of the Metro
latitude This property is required. number
Latitude of the Metro
longitude This property is required. number
Longitude of the Metro
latitude This property is required. float
Latitude of the Metro
longitude This property is required. float
Longitude of the Metro
latitude This property is required. Number
Latitude of the Metro
longitude This property is required. Number
Longitude of the Metro

Package Details

Repository
equinix equinix/pulumi-equinix
License
Apache-2.0
Notes
This Pulumi package is based on the equinix Terraform Provider.
Equinix v0.21.0 published on Friday, Feb 28, 2025 by Equinix