1. Packages
  2. Control Plane (cpln)
  3. API Docs
  4. getLocation
Control Plane v0.0.60 published on Thursday, Jul 3, 2025 by pulumiverse

cpln.getLocation

Explore with Pulumi AI

cpln logo
Control Plane v0.0.60 published on Thursday, Jul 3, 2025 by pulumiverse

    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 "@pulumiverse/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);
            ctx.export("locationEnabled", locationLocation.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,
                     tags: Optional[Mapping[str, str]] = None,
                     opts: Optional[InvokeOptions] = None) -> GetLocationResult
    def get_location_output(name: Optional[pulumi.Input[str]] = None,
                     tags: Optional[pulumi.Input[Mapping[str, 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 dictionary

    The following arguments are supported:

    Name string
    Tags Dictionary<string, string>
    Name string
    Tags map[string]string
    name String
    tags Map<String,String>
    name string
    tags {[key: string]: string}
    name str
    tags Mapping[str, str]
    name String
    tags Map<String>

    getLocation Result

    The following output properties are available:

    CloudProvider string
    CplnId string
    Description string
    Enabled bool
    Geos List<Pulumiverse.Cpln.Outputs.GetLocationGeo>
    Id string
    IpRanges List<string>
    Name string
    Region string
    SelfLink string
    Tags Dictionary<string, string>
    CloudProvider string
    CplnId string
    Description string
    Enabled bool
    Geos []GetLocationGeo
    Id string
    IpRanges []string
    Name string
    Region string
    SelfLink string
    Tags map[string]string
    cloudProvider String
    cplnId String
    description String
    enabled Boolean
    geos List<GetLocationGeo>
    id String
    ipRanges List<String>
    name String
    region String
    selfLink String
    tags Map<String,String>
    cloudProvider string
    cplnId string
    description string
    enabled boolean
    geos GetLocationGeo[]
    id string
    ipRanges string[]
    name string
    region string
    selfLink string
    tags {[key: string]: string}
    cloudProvider String
    cplnId String
    description String
    enabled Boolean
    geos List<Property Map>
    id String
    ipRanges List<String>
    name String
    region String
    selfLink String
    tags Map<String>

    Supporting Types

    GetLocationGeo

    City string
    City of the location.
    Continent string
    Continent of the location.
    Country string
    Country of the location.
    Lat double
    Latitude of the location.
    Lon double
    Longitude of the location.
    State string
    State of the location.
    City string
    City of the location.
    Continent string
    Continent of the location.
    Country string
    Country of the location.
    Lat float64
    Latitude of the location.
    Lon float64
    Longitude of the location.
    State string
    State of the location.
    city String
    City of the location.
    continent String
    Continent of the location.
    country String
    Country of the location.
    lat Double
    Latitude of the location.
    lon Double
    Longitude of the location.
    state String
    State of the location.
    city string
    City of the location.
    continent string
    Continent of the location.
    country string
    Country of the location.
    lat number
    Latitude of the location.
    lon number
    Longitude of the location.
    state string
    State of the location.
    city str
    City of the location.
    continent str
    Continent of the location.
    country str
    Country of the location.
    lat float
    Latitude of the location.
    lon float
    Longitude of the location.
    state str
    State of the location.
    city String
    City of the location.
    continent String
    Continent of the location.
    country String
    Country of the location.
    lat Number
    Latitude of the location.
    lon Number
    Longitude of the location.
    state String
    State of the location.

    Package Details

    Repository
    cpln pulumiverse/pulumi-cpln
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cpln Terraform Provider.
    cpln logo
    Control Plane v0.0.60 published on Thursday, Jul 3, 2025 by pulumiverse