megaport.getLocation
Explore with Pulumi AI
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:
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.
- Live
Date 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.
- Network
Region string - The network region of the location.
- Products
Get
Location Products - The products available in the location.
- Site
Code string - The site code of the location.
- Status string
- The status of the location.
- VRouter
Available 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.
- Live
Date 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.
- Network
Region string - The network region of the location.
- Products
Get
Location Products - The products available in the location.
- Site
Code string - The site code of the location.
- Status string
- The status of the location.
- VRouter
Available 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.
- live
Date 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.
- network
Region String - The network region of the location.
- products
Get
Location Products - The products available in the location.
- site
Code String - The site code of the location.
- status String
- The status of the location.
- v
Router BooleanAvailable - 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.
- live
Date 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.
- network
Region string - The network region of the location.
- products
Get
Location Products - The products available in the location.
- site
Code string - The site code of the location.
- status string
- The status of the location.
- v
Router booleanAvailable - 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
Get
Location Products - The products available in the location.
- site_
code str - The site code of the location.
- status str
- The status of the location.
- v_
router_ boolavailable - 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.
- live
Date 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.
- network
Region String - The network region of the location.
- products Property Map
- The products available in the location.
- site
Code String - The site code of the location.
- status String
- The status of the location.
- v
Router BooleanAvailable - 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.
- Mcr
Version double - The MCR version available at the location.
- Megaports List<double>
- The Megaport availability of the location.
- Mves
List<Get
Location Products Mfe> - 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.
- Mcr
Version float64 - The MCR version available at the location.
- Megaports []float64
- The Megaport availability of the location.
- Mves
[]Get
Location Products Mfe - 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.
- mcr
Version Double - The MCR version available at the location.
- megaports List<Double>
- The Megaport availability of the location.
- mves
List<Get
Location Products Mfe> - 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.
- mcr
Version number - The MCR version available at the location.
- megaports number[]
- The Megaport availability of the location.
- mves
Get
Location Products Mfe[] - 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[Get
Location Products Mfe] - 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.
- mcr
Version 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<Get
Location Products Mfe Detail> - The details of the MVE available in the location.
- Id double
- The ID of the MVE available in the location.
- Max
Cpu doubleCount - The maximum CPU count of the MVE available in the location.
- Product string
- The product of the MVE available in the location.
- Release
Image 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.
- Vendor
Description string - The vendor description of the MVE available in the location.
- Version string
- The version of the MVE available in the location.
- Details
[]Get
Location Products Mfe Detail - The details of the MVE available in the location.
- Id float64
- The ID of the MVE available in the location.
- Max
Cpu float64Count - The maximum CPU count of the MVE available in the location.
- Product string
- The product of the MVE available in the location.
- Release
Image 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.
- Vendor
Description string - The vendor description of the MVE available in the location.
- Version string
- The version of the MVE available in the location.
- details
List<Get
Location Products Mfe Detail> - The details of the MVE available in the location.
- id Double
- The ID of the MVE available in the location.
- max
Cpu DoubleCount - The maximum CPU count of the MVE available in the location.
- product String
- The product of the MVE available in the location.
- release
Image 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.
- vendor
Description String - The vendor description of the MVE available in the location.
- version String
- The version of the MVE available in the location.
- details
Get
Location Products Mfe Detail[] - The details of the MVE available in the location.
- id number
- The ID of the MVE available in the location.
- max
Cpu numberCount - The maximum CPU count of the MVE available in the location.
- product string
- The product of the MVE available in the location.
- release
Image 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.
- vendor
Description string - The vendor description of the MVE available in the location.
- version string
- The version of the MVE available in the location.
- details
Sequence[Get
Location Products Mfe Detail] - The details of the MVE available in the location.
- id float
- The ID of the MVE available in the location.
- max_
cpu_ floatcount - 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.
- max
Cpu NumberCount - The maximum CPU count of the MVE available in the location.
- product String
- The product of the MVE available in the location.
- release
Image 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.
- vendor
Description String - The vendor description of the MVE available in the location.
- version String
- The version of the MVE available in the location.
GetLocationProductsMfeDetail
- Bandwidth
Mbps double - The bandwidth Mbps of the MVE available in the location.
- Cpu
Core doubleCount - The CPU core count of the MVE available in the location.
- Label string
- The label of the MVE available in the location.
- Ram
Gb double - The RAM GB of the MVE available in the location.
- Size string
- The size of the MVE available in the location.
- Bandwidth
Mbps float64 - The bandwidth Mbps of the MVE available in the location.
- Cpu
Core float64Count - The CPU core count of the MVE available in the location.
- Label string
- The label of the MVE available in the location.
- Ram
Gb float64 - The RAM GB of the MVE available in the location.
- Size string
- The size of the MVE available in the location.
- bandwidth
Mbps Double - The bandwidth Mbps of the MVE available in the location.
- cpu
Core DoubleCount - The CPU core count of the MVE available in the location.
- label String
- The label of the MVE available in the location.
- ram
Gb Double - The RAM GB of the MVE available in the location.
- size String
- The size of the MVE available in the location.
- bandwidth
Mbps number - The bandwidth Mbps of the MVE available in the location.
- cpu
Core numberCount - The CPU core count of the MVE available in the location.
- label string
- The label of the MVE available in the location.
- ram
Gb 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_ floatcount - 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.
- bandwidth
Mbps Number - The bandwidth Mbps of the MVE available in the location.
- cpu
Core NumberCount - The CPU core count of the MVE available in the location.
- label String
- The label of the MVE available in the location.
- ram
Gb 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.