Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi
gcp.cloudrun.getLocations
Explore with Pulumi AI
Get Cloud Run locations available for a project.
To get more information about Cloud Run, see:
- API documentation
- How-to Guides
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const available = gcp.cloudrun.getLocations({});
import pulumi
import pulumi_gcp as gcp
available = gcp.cloudrun.get_locations()
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudrun"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudrun.GetLocations(ctx, &cloudrun.GetLocationsArgs{}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var available = Gcp.CloudRun.GetLocations.Invoke();
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.cloudrun.CloudrunFunctions;
import com.pulumi.gcp.cloudrun.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 available = CloudrunFunctions.getLocations();
}
}
variables:
available:
fn::invoke:
Function: gcp:cloudrun:getLocations
Arguments: {}
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>
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]
func GetLocations(ctx *Context, args *GetLocationsArgs, opts ...InvokeOption) (*GetLocationsResult, error)
func GetLocationsOutput(ctx *Context, args *GetLocationsOutputArgs, opts ...InvokeOption) GetLocationsResultOutput
> 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)
}
public static CompletableFuture<GetLocationsResult> getLocations(GetLocationsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:cloudrun/getLocations:getLocations
arguments:
# arguments dictionary
The following arguments are supported:
- Project string
- The project to list versions for. If it is not provided, the provider project is used.
- Project string
- The project to list versions for. If it is not provided, the provider project is used.
- project String
- The project to list versions for. If it is not provided, the provider project is used.
- project string
- The project to list versions for. If it is not provided, the provider project is used.
- project str
- The project to list versions for. If it is not provided, the provider project is used.
- project String
- The project to list versions for. If it is not provided, the provider project is used.
getLocations Result
The following output properties are available:
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.