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

cpln.getLocations

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 all Locations within Control Plane.

    Outputs

    The following attributes are exported:

    • locations (Block List) (see below).

    locations

    • 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 locationsLocations = Cpln.GetLocations.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["locations"] = locationsLocations.Apply(getLocationsResult => getLocationsResult.Locations),
        };
    });
    
    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 {
    		locationsLocations, err := cpln.GetLocations(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("locations", locationsLocations.Locations)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cpln.CplnFunctions;
    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 locationsLocations = CplnFunctions.getLocations();
    
            ctx.export("locations", locationsLocations.applyValue(getLocationsResult -> getLocationsResult.locations()));
        }
    }
    
    import pulumi
    import pulumi_cpln as cpln
    
    locations_locations = cpln.get_locations()
    pulumi.export("locations", locations_locations.locations)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cpln from "@pulumi/cpln";
    
    const locationsLocations = cpln.getLocations({});
    export const locations = locationsLocations.then(locationsLocations => locationsLocations.locations);
    
    variables:
      locationsLocations:
        fn::invoke:
          Function: cpln:getLocations
          Arguments: {}
    outputs:
      locations: ${locationsLocations.locations}
    

    Using getLocations

    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 getLocations(opts?: InvokeOptions): Promise<GetLocationsResult>
    function getLocationsOutput(opts?: InvokeOptions): Output<GetLocationsResult>
    def get_locations(opts: Optional[InvokeOptions] = None) -> GetLocationsResult
    def get_locations_output(opts: Optional[InvokeOptions] = None) -> Output[GetLocationsResult]
    func GetLocations(ctx *Context, opts ...InvokeOption) (*GetLocationsResult, error)
    func GetLocationsOutput(ctx *Context, opts ...InvokeOption) GetLocationsResultOutput

    > Note: This function is named GetLocations in the Go SDK.

    public static class GetLocations 
    {
        public static Task<GetLocationsResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetLocationsResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLocationsResult> getLocations(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: cpln:index/getLocations:getLocations
      arguments:
        # arguments dictionary

    getLocations Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Locations List<Pulumiverse.Cpln.Outputs.GetLocationsLocation>
    Id string
    The provider-assigned unique ID for this managed resource.
    Locations []GetLocationsLocation
    id String
    The provider-assigned unique ID for this managed resource.
    locations List<GetLocationsLocation>
    id string
    The provider-assigned unique ID for this managed resource.
    locations GetLocationsLocation[]
    id str
    The provider-assigned unique ID for this managed resource.
    locations Sequence[GetLocationsLocation]
    id String
    The provider-assigned unique ID for this managed resource.
    locations List<Property Map>

    Supporting Types

    GetLocationsLocation

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

    GetLocationsLocationGeo

    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