1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. alloydb
  5. getLocations
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.alloydb.getLocations

Explore with Pulumi AI

Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

Use this data source to get information about the available locations. For more details refer the API docs.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const qa = gcp.alloydb.getLocations({});
Copy
import pulumi
import pulumi_gcp as gcp

qa = gcp.alloydb.get_locations()
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/alloydb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := alloydb.GetLocations(ctx, &alloydb.GetLocationsArgs{}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var qa = Gcp.Alloydb.GetLocations.Invoke();

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.alloydb.AlloydbFunctions;
import com.pulumi.gcp.alloydb.inputs.GetLocationsArgs;
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 qa = AlloydbFunctions.getLocations();

    }
}
Copy
variables:
  qa:
    fn::invoke:
      function: gcp:alloydb:getLocations
      arguments: {}
Copy

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

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

public static class GetLocations 
{
    public static Task<GetLocationsResult> InvokeAsync(GetLocationsArgs args, InvokeOptions? opts = null)
    public static Output<GetLocationsResult> Invoke(GetLocationsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetLocationsResult> getLocations(GetLocationsArgs args, InvokeOptions options)
public static Output<GetLocationsResult> getLocations(GetLocationsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:alloydb/getLocations:getLocations
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Project string
The ID of the project.
Project string
The ID of the project.
project String
The ID of the project.
project string
The ID of the project.
project str
The ID of the project.
project String
The ID of the project.

getLocations Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Locations List<GetLocationsLocation>
Contains a list of location, which contains the details about a particular location.
Project string
Id string
The provider-assigned unique ID for this managed resource.
Locations []GetLocationsLocation
Contains a list of location, which contains the details about a particular location.
Project string
id String
The provider-assigned unique ID for this managed resource.
locations List<GetLocationsLocation>
Contains a list of location, which contains the details about a particular location.
project String
id string
The provider-assigned unique ID for this managed resource.
locations GetLocationsLocation[]
Contains a list of location, which contains the details about a particular location.
project string
id str
The provider-assigned unique ID for this managed resource.
locations Sequence[GetLocationsLocation]
Contains a list of location, which contains the details about a particular location.
project str
id String
The provider-assigned unique ID for this managed resource.
locations List<Property Map>
Contains a list of location, which contains the details about a particular location.
project String

Supporting Types

GetLocationsLocation

DisplayName This property is required. string
The friendly name for this location, typically a nearby city name. For example, "Tokyo".
Labels This property is required. Dictionary<string, string>
Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}.
LocationId This property is required. string
The canonical id for this location. For example: "us-east1"..
Metadata This property is required. Dictionary<string, string>
Service-specific metadata. For example the available capacity at the given location.
Name This property is required. string
Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1".
DisplayName This property is required. string
The friendly name for this location, typically a nearby city name. For example, "Tokyo".
Labels This property is required. map[string]string
Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}.
LocationId This property is required. string
The canonical id for this location. For example: "us-east1"..
Metadata This property is required. map[string]string
Service-specific metadata. For example the available capacity at the given location.
Name This property is required. string
Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1".
displayName This property is required. String
The friendly name for this location, typically a nearby city name. For example, "Tokyo".
labels This property is required. Map<String,String>
Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}.
locationId This property is required. String
The canonical id for this location. For example: "us-east1"..
metadata This property is required. Map<String,String>
Service-specific metadata. For example the available capacity at the given location.
name This property is required. String
Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1".
displayName This property is required. string
The friendly name for this location, typically a nearby city name. For example, "Tokyo".
labels This property is required. {[key: string]: string}
Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}.
locationId This property is required. string
The canonical id for this location. For example: "us-east1"..
metadata This property is required. {[key: string]: string}
Service-specific metadata. For example the available capacity at the given location.
name This property is required. string
Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1".
display_name This property is required. str
The friendly name for this location, typically a nearby city name. For example, "Tokyo".
labels This property is required. Mapping[str, str]
Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}.
location_id This property is required. str
The canonical id for this location. For example: "us-east1"..
metadata This property is required. Mapping[str, str]
Service-specific metadata. For example the available capacity at the given location.
name This property is required. str
Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1".
displayName This property is required. String
The friendly name for this location, typically a nearby city name. For example, "Tokyo".
labels This property is required. Map<String>
Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}.
locationId This property is required. String
The canonical id for this location. For example: "us-east1"..
metadata This property is required. Map<String>
Service-specific metadata. For example the available capacity at the given location.
name This property is required. String
Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1".

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi