1. Packages
  2. Control Plane (cpln)
  3. API Docs
  4. getLocation
Control Plane v0.0.47 published on Saturday, Nov 9, 2024 by pulumiverse

cpln.getLocation

Explore with Pulumi AI

cpln logo
Control Plane v0.0.47 published on Saturday, Nov 9, 2024 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

    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 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
    	})
    }
    
    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()));
        }
    }
    
    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)
    
    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);
    
    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: cpln:index/getLocation:getLocation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Name string
    name String
    name string
    name str
    name 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
    The provider-assigned unique ID for this managed resource.
    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
    The provider-assigned unique ID for this managed resource.
    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
    The provider-assigned unique ID for this managed resource.
    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
    The provider-assigned unique ID for this managed resource.
    ipRanges string[]
    name string
    region string
    selfLink string
    tags {[key: string]: string}
    cloud_provider str
    cpln_id str
    description str
    enabled bool
    geos Sequence[GetLocationGeo]
    id str
    The provider-assigned unique ID for this managed resource.
    ip_ranges Sequence[str]
    name str
    region str
    self_link str
    tags Mapping[str, str]
    cloudProvider String
    cplnId String
    description String
    enabled Boolean
    geos List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ipRanges List<String>
    name String
    region String
    selfLink String
    tags Map<String>

    Supporting Types

    GetLocationGeo

    City string
    Continent string
    Country string
    Lat double
    Lon double
    State string
    City string
    Continent string
    Country string
    Lat float64
    Lon float64
    State string
    city String
    continent String
    country String
    lat Double
    lon Double
    state String
    city string
    continent string
    country string
    lat number
    lon number
    state string
    city str
    continent str
    country str
    lat float
    lon float
    state str
    city String
    continent String
    country String
    lat Number
    lon Number
    state String

    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.47 published on Saturday, Nov 9, 2024 by pulumiverse