Google Cloud (GCP) Classic

v6.38.0 published on Thursday, Sep 22, 2022 by Pulumi

getInstance

Get a spanner instance from Google Cloud by its name.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var foo = Gcp.Spanner.GetInstance.Invoke(new()
    {
        Name = "bar",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/spanner"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := spanner.LookupInstance(ctx, &spanner.LookupInstanceArgs{
			Name: "bar",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.spanner.SpannerFunctions;
import com.pulumi.gcp.compute.inputs.GetInstanceArgs;
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 foo = SpannerFunctions.getInstance(GetInstanceArgs.builder()
            .name("bar")
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

foo = gcp.spanner.get_instance(name="bar")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const foo = pulumi.output(gcp.spanner.getInstance({
    name: "bar",
}));
variables:
  foo:
    Fn::Invoke:
      Function: gcp:spanner:getInstance
      Arguments:
        name: bar

Using getInstance

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 getInstance(args: GetInstanceArgs, opts?: InvokeOptions): Promise<GetInstanceResult>
function getInstanceOutput(args: GetInstanceOutputArgs, opts?: InvokeOptions): Output<GetInstanceResult>
def get_instance(config: Optional[str] = None,
                 display_name: Optional[str] = None,
                 name: Optional[str] = None,
                 project: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetInstanceResult
def get_instance_output(config: Optional[pulumi.Input[str]] = None,
                 display_name: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetInstanceResult]
func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)
func LookupInstanceOutput(ctx *Context, args *LookupInstanceOutputArgs, opts ...InvokeOption) LookupInstanceResultOutput

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

public static class GetInstance 
{
    public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceResult> Invoke(GetInstanceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: gcp:spanner/getInstance:getInstance
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

The name of the spanner instance.

Config string
DisplayName string
Project string

The project in which the resource belongs. If it is not provided, the provider project is used.

Name string

The name of the spanner instance.

Config string
DisplayName string
Project string

The project in which the resource belongs. If it is not provided, the provider project is used.

name String

The name of the spanner instance.

config String
displayName String
project String

The project in which the resource belongs. If it is not provided, the provider project is used.

name string

The name of the spanner instance.

config string
displayName string
project string

The project in which the resource belongs. If it is not provided, the provider project is used.

name str

The name of the spanner instance.

config str
display_name str
project str

The project in which the resource belongs. If it is not provided, the provider project is used.

name String

The name of the spanner instance.

config String
displayName String
project String

The project in which the resource belongs. If it is not provided, the provider project is used.

getInstance Result

The following output properties are available:

ForceDestroy bool
Id string

The provider-assigned unique ID for this managed resource.

Labels Dictionary<string, string>
Name string
NumNodes int
ProcessingUnits int
State string
Config string
DisplayName string
Project string
ForceDestroy bool
Id string

The provider-assigned unique ID for this managed resource.

Labels map[string]string
Name string
NumNodes int
ProcessingUnits int
State string
Config string
DisplayName string
Project string
forceDestroy Boolean
id String

The provider-assigned unique ID for this managed resource.

labels Map<String,String>
name String
numNodes Integer
processingUnits Integer
state String
config String
displayName String
project String
forceDestroy boolean
id string

The provider-assigned unique ID for this managed resource.

labels {[key: string]: string}
name string
numNodes number
processingUnits number
state string
config string
displayName string
project string
force_destroy bool
id str

The provider-assigned unique ID for this managed resource.

labels Mapping[str, str]
name str
num_nodes int
processing_units int
state str
config str
display_name str
project str
forceDestroy Boolean
id String

The provider-assigned unique ID for this managed resource.

labels Map<String>
name String
numNodes Number
processingUnits Number
state String
config String
displayName String
project String

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.