Control Plane v0.0.56 published on Wednesday, Apr 9, 2025 by pulumiverse
cpln.getLocation
Explore with Pulumi AI
Use this data source to access information about a Location within Control Plane.
Required
- name (String) Name of the location (i.e. 
aws-us-west-2). 
Outputs
The following attributes are exported:
- cpln_id (String) The ID, in GUID format, of the location.
 - name (String) Name of the location.
 - description (String) Description of the location.
 - tags (Map of String) Key-value map of resource tags.
 - cloud_provider (String) Cloud Provider of the location.
 - region (String) Region of the location.
 - enabled (Boolean) Indication if location is enabled.
 - geo (Block List, Max: 1) (see below)
 - ip_ranges (List of String) A list of IP ranges of the location.
 - self_link (String) Full link to this resource. Can be referenced by other resources.
 
geo
Location geographical details
- lat (Number) Latitude.
 - lon (Number) Longitude.
 - country (String) Country.
 - state (String) State.
 - city (String) City.
 - continent (String) Continent.
 
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cpln from "@pulumi/cpln";
const locationLocation = cpln.getLocation({
    name: "aws-us-west-2",
});
export const location = locationLocation;
export const locationEnabled = locationLocation.then(locationLocation => locationLocation.enabled);
import pulumi
import pulumi_cpln as cpln
location_location = cpln.get_location(name="aws-us-west-2")
pulumi.export("location", location_location)
pulumi.export("locationEnabled", location_location.enabled)
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-cpln/sdk/go/cpln"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		locationLocation, err := cpln.LookupLocation(ctx, &cpln.LookupLocationArgs{
			Name: "aws-us-west-2",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("location", locationLocation)
		ctx.Export("locationEnabled", locationLocation.Enabled)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cpln = Pulumi.Cpln;
return await Deployment.RunAsync(() => 
{
    var locationLocation = Cpln.GetLocation.Invoke(new()
    {
        Name = "aws-us-west-2",
    });
    return new Dictionary<string, object?>
    {
        ["location"] = locationLocation,
        ["locationEnabled"] = locationLocation.Apply(getLocationResult => getLocationResult.Enabled),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cpln.CplnFunctions;
import com.pulumi.cpln.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 locationLocation = CplnFunctions.getLocation(GetLocationArgs.builder()
            .name("aws-us-west-2")
            .build());
        ctx.export("location", locationLocation.applyValue(getLocationResult -> getLocationResult));
        ctx.export("locationEnabled", locationLocation.applyValue(getLocationResult -> getLocationResult.enabled()));
    }
}
variables:
  locationLocation:
    fn::invoke:
      function: cpln:getLocation
      arguments:
        name: aws-us-west-2
outputs:
  location: ${locationLocation}
  locationEnabled: ${locationLocation.enabled}
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(name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetLocationResult
def get_location_output(name: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetLocationResult]func LookupLocation(ctx *Context, args *LookupLocationArgs, opts ...InvokeOption) (*LookupLocationResult, error)
func LookupLocationOutput(ctx *Context, args *LookupLocationOutputArgs, opts ...InvokeOption) LookupLocationResultOutput> Note: This function is named LookupLocation 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: cpln:index/getLocation:getLocation
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
 
- Name string
 
- name String
 
- name string
 
- name str
 
- name String
 
getLocation Result
The following output properties are available:
- Cloud
Provider string - Cpln
Id string - Description string
 - Enabled bool
 - Geos
List<Pulumiverse.
Cpln. Outputs. Get Location Geo>  - Id string
 - The provider-assigned unique ID for this managed resource.
 - Ip
Ranges List<string> - Name string
 - Region string
 - Self
Link string - Dictionary<string, string>
 
- Cloud
Provider string - Cpln
Id string - Description string
 - Enabled bool
 - Geos
[]Get
Location Geo  - Id string
 - The provider-assigned unique ID for this managed resource.
 - Ip
Ranges []string - Name string
 - Region string
 - Self
Link string - map[string]string
 
- cloud
Provider String - cpln
Id String - description String
 - enabled Boolean
 - geos
List<Get
Location Geo>  - id String
 - The provider-assigned unique ID for this managed resource.
 - ip
Ranges List<String> - name String
 - region String
 - self
Link String - Map<String,String>
 
- cloud
Provider string - cpln
Id string - description string
 - enabled boolean
 - geos
Get
Location Geo[]  - id string
 - The provider-assigned unique ID for this managed resource.
 - ip
Ranges string[] - name string
 - region string
 - self
Link string - {[key: string]: string}
 
- cloud_
provider str - cpln_
id str - description str
 - enabled bool
 - geos
Sequence[Get
Location Geo]  - id str
 - The provider-assigned unique ID for this managed resource.
 - ip_
ranges Sequence[str] - name str
 - region str
 - self_
link str - Mapping[str, str]
 
- cloud
Provider String - cpln
Id String - description String
 - enabled Boolean
 - geos List<Property Map>
 - id String
 - The provider-assigned unique ID for this managed resource.
 - ip
Ranges List<String> - name String
 - region String
 - self
Link String - Map<String>
 
Supporting Types
GetLocationGeo  
Package Details
- Repository
 - cpln pulumiverse/pulumi-cpln
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
cplnTerraform Provider.