1. Packages
  2. Megaport Provider
  3. API Docs
  4. getLocation
megaport 1.4.1 published on Tuesday, Aug 12, 2025 by megaport

megaport.getLocation

Explore with Pulumi AI

megaport logo
megaport 1.4.1 published on Tuesday, Aug 12, 2025 by megaport

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as megaport from "@pulumi/megaport";
    
    const myLocation1 = megaport.getLocation({
        id: 5,
    });
    const myLocation2 = megaport.getLocation({
        name: "NextDC B1",
    });
    
    import pulumi
    import pulumi_megaport as megaport
    
    my_location1 = megaport.get_location(id=5)
    my_location2 = megaport.get_location(name="NextDC B1")
    
    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{
    			Id: pulumi.Float64Ref(5),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = megaport.GetLocation(ctx, &megaport.GetLocationArgs{
    			Name: pulumi.StringRef("NextDC B1"),
    		}, 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()
        {
            Id = 5,
        });
    
        var myLocation2 = Megaport.GetLocation.Invoke(new()
        {
            Name = "NextDC B1",
        });
    
    });
    
    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()
                .id(5)
                .build());
    
            final var myLocation2 = MegaportFunctions.getLocation(GetLocationArgs.builder()
                .name("NextDC B1")
                .build());
    
        }
    }
    
    variables:
      myLocation1:
        fn::invoke:
          function: megaport:getLocation
          arguments:
            id: 5
      myLocation2:
        fn::invoke:
          function: megaport:getLocation
          arguments:
            name: NextDC B1
    

    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. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    Name string
    The name of the location. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    SiteCode string
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    Id float64
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    Name string
    The name of the location. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    SiteCode string
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    id Double
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    name String
    The name of the location. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    siteCode String
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    id number
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    name string
    The name of the location. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    siteCode string
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    id float
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    name str
    The name of the location. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    site_code str
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    id Number
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    name String
    The name of the location. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    siteCode String
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.

    getLocation Result

    The following output properties are available:

    Address Dictionary<string, string>
    The address of the location.
    Campus string
    DEPRECATED: The campus field is no longer available in the v3 locations API and will be removed in a future version.
    Country string
    The country of the location.
    Id double
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    Latitude double
    The latitude of the location.
    LiveDate string
    DEPRECATED: The live_date field is no longer available in the v3 locations API and will be removed in a future version.
    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. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    NetworkRegion string
    DEPRECATED: The network_region field is no longer available in the v3 locations API and will be removed in a future version.
    Products GetLocationProducts
    The products available in the location.
    SiteCode string
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    Status string
    The status of the location.
    VRouterAvailable bool
    DEPRECATED: The vrouteravailable field is no longer available in the v3 locations API and will be removed in a future version.
    Address map[string]string
    The address of the location.
    Campus string
    DEPRECATED: The campus field is no longer available in the v3 locations API and will be removed in a future version.
    Country string
    The country of the location.
    Id float64
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    Latitude float64
    The latitude of the location.
    LiveDate string
    DEPRECATED: The live_date field is no longer available in the v3 locations API and will be removed in a future version.
    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. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    NetworkRegion string
    DEPRECATED: The network_region field is no longer available in the v3 locations API and will be removed in a future version.
    Products GetLocationProducts
    The products available in the location.
    SiteCode string
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    Status string
    The status of the location.
    VRouterAvailable bool
    DEPRECATED: The vrouteravailable field is no longer available in the v3 locations API and will be removed in a future version.
    address Map<String,String>
    The address of the location.
    campus String
    DEPRECATED: The campus field is no longer available in the v3 locations API and will be removed in a future version.
    country String
    The country of the location.
    id Double
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    latitude Double
    The latitude of the location.
    liveDate String
    DEPRECATED: The live_date field is no longer available in the v3 locations API and will be removed in a future version.
    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. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    networkRegion String
    DEPRECATED: The network_region field is no longer available in the v3 locations API and will be removed in a future version.
    products GetLocationProducts
    The products available in the location.
    siteCode String
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    status String
    The status of the location.
    vRouterAvailable Boolean
    DEPRECATED: The vrouteravailable field is no longer available in the v3 locations API and will be removed in a future version.
    address {[key: string]: string}
    The address of the location.
    campus string
    DEPRECATED: The campus field is no longer available in the v3 locations API and will be removed in a future version.
    country string
    The country of the location.
    id number
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    latitude number
    The latitude of the location.
    liveDate string
    DEPRECATED: The live_date field is no longer available in the v3 locations API and will be removed in a future version.
    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. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    networkRegion string
    DEPRECATED: The network_region field is no longer available in the v3 locations API and will be removed in a future version.
    products GetLocationProducts
    The products available in the location.
    siteCode string
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    status string
    The status of the location.
    vRouterAvailable boolean
    DEPRECATED: The vrouteravailable field is no longer available in the v3 locations API and will be removed in a future version.
    address Mapping[str, str]
    The address of the location.
    campus str
    DEPRECATED: The campus field is no longer available in the v3 locations API and will be removed in a future version.
    country str
    The country of the location.
    id float
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    latitude float
    The latitude of the location.
    live_date str
    DEPRECATED: The live_date field is no longer available in the v3 locations API and will be removed in a future version.
    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. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    network_region str
    DEPRECATED: The network_region field is no longer available in the v3 locations API and will be removed in a future version.
    products GetLocationProducts
    The products available in the location.
    site_code str
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    status str
    The status of the location.
    v_router_available bool
    DEPRECATED: The vrouteravailable field is no longer available in the v3 locations API and will be removed in a future version.
    address Map<String>
    The address of the location.
    campus String
    DEPRECATED: The campus field is no longer available in the v3 locations API and will be removed in a future version.
    country String
    The country of the location.
    id Number
    The ID of the location. Using ID is strongly recommended as the most reliable way to identify locations since IDs remain constant, unlike names and site codes which can change.
    latitude Number
    The latitude of the location.
    liveDate String
    DEPRECATED: The live_date field is no longer available in the v3 locations API and will be removed in a future version.
    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. Note that location names can change over time, which may lead to non-deterministic behavior. For consistent results, use the location ID instead.
    networkRegion String
    DEPRECATED: The network_region field is no longer available in the v3 locations API and will be removed in a future version.
    products Property Map
    The products available in the location.
    siteCode String
    DEPRECATED: The sitecode field is no longer available in the v3 locations API and will be removed in a future version. Use the location ID instead. Filtering by sitecode is no longer supported.
    status String
    The status of the location.
    vRouterAvailable Boolean
    DEPRECATED: The vrouteravailable field is no longer available in the v3 locations API and will be removed in a future version.

    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.4.1 published on Tuesday, Aug 12, 2025 by megaport