1. Packages
  2. Megaport Provider
  3. API Docs
  4. getLocation
megaport 1.3.6 published on Wednesday, Apr 30, 2025 by megaport

megaport.getLocation

Explore with Pulumi AI

megaport logo
megaport 1.3.6 published on Wednesday, Apr 30, 2025 by megaport

    Location data source for Megaport. Returns a list of data centers where you can order a Megaport, MCR, or MVE. You use the ‘id’, ’name’, or ‘site_code’ field to identify a specific data center. Please note that names and site_codes of data centers are subject to change (while IDs will remain constant), and the most up to date listing of locations can be retrieved from the Megaport API at GET /v2/locations

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as megaport from "@pulumi/megaport";
    
    const myLocation1 = megaport.getLocation({
        name: "NextDC B1",
    });
    const myLocation2 = megaport.getLocation({
        siteCode: "bne_nxt1",
    });
    const myLocation3 = megaport.getLocation({
        id: 5,
    });
    
    import pulumi
    import pulumi_megaport as megaport
    
    my_location1 = megaport.get_location(name="NextDC B1")
    my_location2 = megaport.get_location(site_code="bne_nxt1")
    my_location3 = megaport.get_location(id=5)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/megaport/megaport"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := megaport.GetLocation(ctx, &megaport.GetLocationArgs{
    			Name: pulumi.StringRef("NextDC B1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = megaport.GetLocation(ctx, &megaport.GetLocationArgs{
    			SiteCode: pulumi.StringRef("bne_nxt1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = megaport.GetLocation(ctx, &megaport.GetLocationArgs{
    			Id: pulumi.Float64Ref(5),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Megaport = Pulumi.Megaport;
    
    return await Deployment.RunAsync(() => 
    {
        var myLocation1 = Megaport.GetLocation.Invoke(new()
        {
            Name = "NextDC B1",
        });
    
        var myLocation2 = Megaport.GetLocation.Invoke(new()
        {
            SiteCode = "bne_nxt1",
        });
    
        var myLocation3 = Megaport.GetLocation.Invoke(new()
        {
            Id = 5,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.megaport.MegaportFunctions;
    import com.pulumi.megaport.inputs.GetLocationArgs;
    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 myLocation1 = MegaportFunctions.getLocation(GetLocationArgs.builder()
                .name("NextDC B1")
                .build());
    
            final var myLocation2 = MegaportFunctions.getLocation(GetLocationArgs.builder()
                .siteCode("bne_nxt1")
                .build());
    
            final var myLocation3 = MegaportFunctions.getLocation(GetLocationArgs.builder()
                .id(5)
                .build());
    
        }
    }
    
    variables:
      myLocation1:
        fn::invoke:
          function: megaport:getLocation
          arguments:
            name: NextDC B1
      myLocation2:
        fn::invoke:
          function: megaport:getLocation
          arguments:
            siteCode: bne_nxt1
      myLocation3:
        fn::invoke:
          function: megaport:getLocation
          arguments:
            id: 5
    

    Using getLocation

    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 getLocation(args: GetLocationArgs, opts?: InvokeOptions): Promise<GetLocationResult>
    function getLocationOutput(args: GetLocationOutputArgs, opts?: InvokeOptions): Output<GetLocationResult>
    def get_location(id: Optional[float] = None,
                     name: Optional[str] = None,
                     site_code: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetLocationResult
    def get_location_output(id: Optional[pulumi.Input[float]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     site_code: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetLocationResult]
    func GetLocation(ctx *Context, args *GetLocationArgs, opts ...InvokeOption) (*GetLocationResult, error)
    func GetLocationOutput(ctx *Context, args *GetLocationOutputArgs, opts ...InvokeOption) GetLocationResultOutput

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

    public static class GetLocation 
    {
        public static Task<GetLocationResult> InvokeAsync(GetLocationArgs args, InvokeOptions? opts = null)
        public static Output<GetLocationResult> Invoke(GetLocationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLocationResult> getLocation(GetLocationArgs args, InvokeOptions options)
    public static Output<GetLocationResult> getLocation(GetLocationArgs args, InvokeOptions options)
    
    fn::invoke:
      function: megaport:index/getLocation:getLocation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id double
    The ID of the location.
    Name string
    The name of the location.
    SiteCode string
    The site code of the location.
    Id float64
    The ID of the location.
    Name string
    The name of the location.
    SiteCode string
    The site code of the location.
    id Double
    The ID of the location.
    name String
    The name of the location.
    siteCode String
    The site code of the location.
    id number
    The ID of the location.
    name string
    The name of the location.
    siteCode string
    The site code of the location.
    id float
    The ID of the location.
    name str
    The name of the location.
    site_code str
    The site code of the location.
    id Number
    The ID of the location.
    name String
    The name of the location.
    siteCode String
    The site code of the location.

    getLocation Result

    The following output properties are available:

    Address Dictionary<string, string>
    The address of the location.
    Campus string
    The campus of the location.
    Country string
    The country of the location.
    Id double
    The ID of the location.
    Latitude double
    The latitude of the location.
    LiveDate string
    The live date of the location.
    Longitude double
    The longitude of the location.
    Market string
    The market of the location.
    Metro string
    The metro of the location.
    Name string
    The name of the location.
    NetworkRegion string
    The network region of the location.
    Products GetLocationProducts
    The products available in the location.
    SiteCode string
    The site code of the location.
    Status string
    The status of the location.
    VRouterAvailable bool
    The vRouter availability of the location.
    Address map[string]string
    The address of the location.
    Campus string
    The campus of the location.
    Country string
    The country of the location.
    Id float64
    The ID of the location.
    Latitude float64
    The latitude of the location.
    LiveDate string
    The live date of the location.
    Longitude float64
    The longitude of the location.
    Market string
    The market of the location.
    Metro string
    The metro of the location.
    Name string
    The name of the location.
    NetworkRegion string
    The network region of the location.
    Products GetLocationProducts
    The products available in the location.
    SiteCode string
    The site code of the location.
    Status string
    The status of the location.
    VRouterAvailable bool
    The vRouter availability of the location.
    address Map<String,String>
    The address of the location.
    campus String
    The campus of the location.
    country String
    The country of the location.
    id Double
    The ID of the location.
    latitude Double
    The latitude of the location.
    liveDate String
    The live date of the location.
    longitude Double
    The longitude of the location.
    market String
    The market of the location.
    metro String
    The metro of the location.
    name String
    The name of the location.
    networkRegion String
    The network region of the location.
    products GetLocationProducts
    The products available in the location.
    siteCode String
    The site code of the location.
    status String
    The status of the location.
    vRouterAvailable Boolean
    The vRouter availability of the location.
    address {[key: string]: string}
    The address of the location.
    campus string
    The campus of the location.
    country string
    The country of the location.
    id number
    The ID of the location.
    latitude number
    The latitude of the location.
    liveDate string
    The live date of the location.
    longitude number
    The longitude of the location.
    market string
    The market of the location.
    metro string
    The metro of the location.
    name string
    The name of the location.
    networkRegion string
    The network region of the location.
    products GetLocationProducts
    The products available in the location.
    siteCode string
    The site code of the location.
    status string
    The status of the location.
    vRouterAvailable boolean
    The vRouter availability of the location.
    address Mapping[str, str]
    The address of the location.
    campus str
    The campus of the location.
    country str
    The country of the location.
    id float
    The ID of the location.
    latitude float
    The latitude of the location.
    live_date str
    The live date of the location.
    longitude float
    The longitude of the location.
    market str
    The market of the location.
    metro str
    The metro of the location.
    name str
    The name of the location.
    network_region str
    The network region of the location.
    products GetLocationProducts
    The products available in the location.
    site_code str
    The site code of the location.
    status str
    The status of the location.
    v_router_available bool
    The vRouter availability of the location.
    address Map<String>
    The address of the location.
    campus String
    The campus of the location.
    country String
    The country of the location.
    id Number
    The ID of the location.
    latitude Number
    The latitude of the location.
    liveDate String
    The live date of the location.
    longitude Number
    The longitude of the location.
    market String
    The market of the location.
    metro String
    The metro of the location.
    name String
    The name of the location.
    networkRegion String
    The network region of the location.
    products Property Map
    The products available in the location.
    siteCode String
    The site code of the location.
    status String
    The status of the location.
    vRouterAvailable Boolean
    The vRouter availability of the location.

    Supporting Types

    GetLocationProducts

    Mcr bool
    The MCR availability of the location.
    Mcr1s List<double>
    The MCR1 bandwidth availability of the location.
    Mcr2s List<double>
    The MCR2 bandwidth availability of the location.
    McrVersion double
    The MCR version available at the location.
    Megaports List<double>
    The Megaport availability of the location.
    Mves List<GetLocationProductsMfe>
    The MVE availability of the location.
    Mcr bool
    The MCR availability of the location.
    Mcr1s []float64
    The MCR1 bandwidth availability of the location.
    Mcr2s []float64
    The MCR2 bandwidth availability of the location.
    McrVersion float64
    The MCR version available at the location.
    Megaports []float64
    The Megaport availability of the location.
    Mves []GetLocationProductsMfe
    The MVE availability of the location.
    mcr Boolean
    The MCR availability of the location.
    mcr1s List<Double>
    The MCR1 bandwidth availability of the location.
    mcr2s List<Double>
    The MCR2 bandwidth availability of the location.
    mcrVersion Double
    The MCR version available at the location.
    megaports List<Double>
    The Megaport availability of the location.
    mves List<GetLocationProductsMfe>
    The MVE availability of the location.
    mcr boolean
    The MCR availability of the location.
    mcr1s number[]
    The MCR1 bandwidth availability of the location.
    mcr2s number[]
    The MCR2 bandwidth availability of the location.
    mcrVersion number
    The MCR version available at the location.
    megaports number[]
    The Megaport availability of the location.
    mves GetLocationProductsMfe[]
    The MVE availability of the location.
    mcr bool
    The MCR availability of the location.
    mcr1s Sequence[float]
    The MCR1 bandwidth availability of the location.
    mcr2s Sequence[float]
    The MCR2 bandwidth availability of the location.
    mcr_version float
    The MCR version available at the location.
    megaports Sequence[float]
    The Megaport availability of the location.
    mves Sequence[GetLocationProductsMfe]
    The MVE availability of the location.
    mcr Boolean
    The MCR availability of the location.
    mcr1s List<Number>
    The MCR1 bandwidth availability of the location.
    mcr2s List<Number>
    The MCR2 bandwidth availability of the location.
    mcrVersion Number
    The MCR version available at the location.
    megaports List<Number>
    The Megaport availability of the location.
    mves List<Property Map>
    The MVE availability of the location.

    GetLocationProductsMfe

    Details List<GetLocationProductsMfeDetail>
    The details of the MVE available in the location.
    Id double
    The ID of the MVE available in the location.
    MaxCpuCount double
    The maximum CPU count of the MVE available in the location.
    Product string
    The product of the MVE available in the location.
    ReleaseImage bool
    Whether there is a release image or not.
    Sizes List<string>
    The sizes available in the location.
    Vendor string
    The vendor of the MVE available in the location.
    VendorDescription string
    The vendor description of the MVE available in the location.
    Version string
    The version of the MVE available in the location.
    Details []GetLocationProductsMfeDetail
    The details of the MVE available in the location.
    Id float64
    The ID of the MVE available in the location.
    MaxCpuCount float64
    The maximum CPU count of the MVE available in the location.
    Product string
    The product of the MVE available in the location.
    ReleaseImage bool
    Whether there is a release image or not.
    Sizes []string
    The sizes available in the location.
    Vendor string
    The vendor of the MVE available in the location.
    VendorDescription string
    The vendor description of the MVE available in the location.
    Version string
    The version of the MVE available in the location.
    details List<GetLocationProductsMfeDetail>
    The details of the MVE available in the location.
    id Double
    The ID of the MVE available in the location.
    maxCpuCount Double
    The maximum CPU count of the MVE available in the location.
    product String
    The product of the MVE available in the location.
    releaseImage Boolean
    Whether there is a release image or not.
    sizes List<String>
    The sizes available in the location.
    vendor String
    The vendor of the MVE available in the location.
    vendorDescription String
    The vendor description of the MVE available in the location.
    version String
    The version of the MVE available in the location.
    details GetLocationProductsMfeDetail[]
    The details of the MVE available in the location.
    id number
    The ID of the MVE available in the location.
    maxCpuCount number
    The maximum CPU count of the MVE available in the location.
    product string
    The product of the MVE available in the location.
    releaseImage boolean
    Whether there is a release image or not.
    sizes string[]
    The sizes available in the location.
    vendor string
    The vendor of the MVE available in the location.
    vendorDescription string
    The vendor description of the MVE available in the location.
    version string
    The version of the MVE available in the location.
    details Sequence[GetLocationProductsMfeDetail]
    The details of the MVE available in the location.
    id float
    The ID of the MVE available in the location.
    max_cpu_count float
    The maximum CPU count of the MVE available in the location.
    product str
    The product of the MVE available in the location.
    release_image bool
    Whether there is a release image or not.
    sizes Sequence[str]
    The sizes available in the location.
    vendor str
    The vendor of the MVE available in the location.
    vendor_description str
    The vendor description of the MVE available in the location.
    version str
    The version of the MVE available in the location.
    details List<Property Map>
    The details of the MVE available in the location.
    id Number
    The ID of the MVE available in the location.
    maxCpuCount Number
    The maximum CPU count of the MVE available in the location.
    product String
    The product of the MVE available in the location.
    releaseImage Boolean
    Whether there is a release image or not.
    sizes List<String>
    The sizes available in the location.
    vendor String
    The vendor of the MVE available in the location.
    vendorDescription String
    The vendor description of the MVE available in the location.
    version String
    The version of the MVE available in the location.

    GetLocationProductsMfeDetail

    BandwidthMbps double
    The bandwidth Mbps of the MVE available in the location.
    CpuCoreCount double
    The CPU core count of the MVE available in the location.
    Label string
    The label of the MVE available in the location.
    RamGb double
    The RAM GB of the MVE available in the location.
    Size string
    The size of the MVE available in the location.
    BandwidthMbps float64
    The bandwidth Mbps of the MVE available in the location.
    CpuCoreCount float64
    The CPU core count of the MVE available in the location.
    Label string
    The label of the MVE available in the location.
    RamGb float64
    The RAM GB of the MVE available in the location.
    Size string
    The size of the MVE available in the location.
    bandwidthMbps Double
    The bandwidth Mbps of the MVE available in the location.
    cpuCoreCount Double
    The CPU core count of the MVE available in the location.
    label String
    The label of the MVE available in the location.
    ramGb Double
    The RAM GB of the MVE available in the location.
    size String
    The size of the MVE available in the location.
    bandwidthMbps number
    The bandwidth Mbps of the MVE available in the location.
    cpuCoreCount number
    The CPU core count of the MVE available in the location.
    label string
    The label of the MVE available in the location.
    ramGb number
    The RAM GB of the MVE available in the location.
    size string
    The size of the MVE available in the location.
    bandwidth_mbps float
    The bandwidth Mbps of the MVE available in the location.
    cpu_core_count float
    The CPU core count of the MVE available in the location.
    label str
    The label of the MVE available in the location.
    ram_gb float
    The RAM GB of the MVE available in the location.
    size str
    The size of the MVE available in the location.
    bandwidthMbps Number
    The bandwidth Mbps of the MVE available in the location.
    cpuCoreCount Number
    The CPU core count of the MVE available in the location.
    label String
    The label of the MVE available in the location.
    ramGb Number
    The RAM GB of the MVE available in the location.
    size String
    The size of the MVE available in the location.

    Package Details

    Repository
    megaport megaport/terraform-provider-megaport
    License
    Notes
    This Pulumi package is based on the megaport Terraform Provider.
    megaport logo
    megaport 1.3.6 published on Wednesday, Apr 30, 2025 by megaport