Google Cloud v8.21.0 published on Wednesday, Mar 5, 2025 by Pulumi
gcp.spanner.getInstance
Explore with Pulumi AI
Get a spanner instance from Google Cloud by its name.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const foo = gcp.spanner.getInstance({
    name: "bar",
});
import pulumi
import pulumi_gcp as gcp
foo = gcp.spanner.get_instance(name="bar")
package main
import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/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
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() => 
{
    var foo = Gcp.Spanner.GetInstance.Invoke(new()
    {
        Name = "bar",
    });
});
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.spanner.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());
    }
}
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)
public static Output<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
fn::invoke:
  function: gcp:spanner/getInstance:getInstance
  arguments:
    # arguments dictionaryThe 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:
- AutoscalingConfigs List<GetInstance Autoscaling Config> 
- DefaultBackup stringSchedule Type 
- Edition string
- EffectiveLabels Dictionary<string, string>
- ForceDestroy bool
- Id string
- The provider-assigned unique ID for this managed resource.
- Labels Dictionary<string, string>
- Name string
- NumNodes int
- ProcessingUnits int
- PulumiLabels Dictionary<string, string>
- State string
- Config string
- DisplayName string
- Project string
- AutoscalingConfigs []GetInstance Autoscaling Config 
- DefaultBackup stringSchedule Type 
- Edition string
- EffectiveLabels map[string]string
- ForceDestroy bool
- Id string
- The provider-assigned unique ID for this managed resource.
- Labels map[string]string
- Name string
- NumNodes int
- ProcessingUnits int
- PulumiLabels map[string]string
- State string
- Config string
- DisplayName string
- Project string
- autoscalingConfigs List<GetInstance Autoscaling Config> 
- defaultBackup StringSchedule Type 
- edition String
- effectiveLabels Map<String,String>
- forceDestroy Boolean
- id String
- The provider-assigned unique ID for this managed resource.
- labels Map<String,String>
- name String
- numNodes Integer
- processingUnits Integer
- pulumiLabels Map<String,String>
- state String
- config String
- displayName String
- project String
- autoscalingConfigs GetInstance Autoscaling Config[] 
- defaultBackup stringSchedule Type 
- edition string
- effectiveLabels {[key: string]: string}
- forceDestroy boolean
- id string
- The provider-assigned unique ID for this managed resource.
- labels {[key: string]: string}
- name string
- numNodes number
- processingUnits number
- pulumiLabels {[key: string]: string}
- state string
- config string
- displayName string
- project string
- autoscaling_configs Sequence[GetInstance Autoscaling Config] 
- default_backup_ strschedule_ type 
- edition str
- effective_labels Mapping[str, str]
- 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
- pulumi_labels Mapping[str, str]
- state str
- config str
- display_name str
- project str
- autoscalingConfigs List<Property Map>
- defaultBackup StringSchedule Type 
- edition String
- effectiveLabels Map<String>
- forceDestroy Boolean
- id String
- The provider-assigned unique ID for this managed resource.
- labels Map<String>
- name String
- numNodes Number
- processingUnits Number
- pulumiLabels Map<String>
- state String
- config String
- displayName String
- project String
Supporting Types
GetInstanceAutoscalingConfig   
- AsymmetricAutoscaling List<GetOptions Instance Autoscaling Config Asymmetric Autoscaling Option> 
- Asymmetric autoscaling options for specific replicas.
- AutoscalingLimits List<GetInstance Autoscaling Config Autoscaling Limit> 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events. Users can define the minimum and maximum compute capacity allocated to the instance, and the autoscaler will only scale within that range. Users can either use nodes or processing units to specify the limits, but should use the same unit to set both the min_limit and max_limit.
- AutoscalingTargets List<GetInstance Autoscaling Config Autoscaling Target> 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
- AsymmetricAutoscaling []GetOptions Instance Autoscaling Config Asymmetric Autoscaling Option 
- Asymmetric autoscaling options for specific replicas.
- AutoscalingLimits []GetInstance Autoscaling Config Autoscaling Limit 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events. Users can define the minimum and maximum compute capacity allocated to the instance, and the autoscaler will only scale within that range. Users can either use nodes or processing units to specify the limits, but should use the same unit to set both the min_limit and max_limit.
- AutoscalingTargets []GetInstance Autoscaling Config Autoscaling Target 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
- asymmetricAutoscaling List<GetOptions Instance Autoscaling Config Asymmetric Autoscaling Option> 
- Asymmetric autoscaling options for specific replicas.
- autoscalingLimits List<GetInstance Autoscaling Config Autoscaling Limit> 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events. Users can define the minimum and maximum compute capacity allocated to the instance, and the autoscaler will only scale within that range. Users can either use nodes or processing units to specify the limits, but should use the same unit to set both the min_limit and max_limit.
- autoscalingTargets List<GetInstance Autoscaling Config Autoscaling Target> 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
- asymmetricAutoscaling GetOptions Instance Autoscaling Config Asymmetric Autoscaling Option[] 
- Asymmetric autoscaling options for specific replicas.
- autoscalingLimits GetInstance Autoscaling Config Autoscaling Limit[] 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events. Users can define the minimum and maximum compute capacity allocated to the instance, and the autoscaler will only scale within that range. Users can either use nodes or processing units to specify the limits, but should use the same unit to set both the min_limit and max_limit.
- autoscalingTargets GetInstance Autoscaling Config Autoscaling Target[] 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
- asymmetric_autoscaling_ Sequence[Getoptions Instance Autoscaling Config Asymmetric Autoscaling Option] 
- Asymmetric autoscaling options for specific replicas.
- autoscaling_limits Sequence[GetInstance Autoscaling Config Autoscaling Limit] 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events. Users can define the minimum and maximum compute capacity allocated to the instance, and the autoscaler will only scale within that range. Users can either use nodes or processing units to specify the limits, but should use the same unit to set both the min_limit and max_limit.
- autoscaling_targets Sequence[GetInstance Autoscaling Config Autoscaling Target] 
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
- asymmetricAutoscaling List<Property Map>Options 
- Asymmetric autoscaling options for specific replicas.
- autoscalingLimits List<Property Map>
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events. Users can define the minimum and maximum compute capacity allocated to the instance, and the autoscaler will only scale within that range. Users can either use nodes or processing units to specify the limits, but should use the same unit to set both the min_limit and max_limit.
- autoscalingTargets List<Property Map>
- Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
GetInstanceAutoscalingConfigAsymmetricAutoscalingOption      
- Overrides
List<GetInstance Autoscaling Config Asymmetric Autoscaling Option Override> 
- A nested object resource.
- ReplicaSelections List<GetInstance Autoscaling Config Asymmetric Autoscaling Option Replica Selection> 
- A nested object resource.
- Overrides
[]GetInstance Autoscaling Config Asymmetric Autoscaling Option Override 
- A nested object resource.
- ReplicaSelections []GetInstance Autoscaling Config Asymmetric Autoscaling Option Replica Selection 
- A nested object resource.
- overrides
List<GetInstance Autoscaling Config Asymmetric Autoscaling Option Override> 
- A nested object resource.
- replicaSelections List<GetInstance Autoscaling Config Asymmetric Autoscaling Option Replica Selection> 
- A nested object resource.
- overrides
GetInstance Autoscaling Config Asymmetric Autoscaling Option Override[] 
- A nested object resource.
- replicaSelections GetInstance Autoscaling Config Asymmetric Autoscaling Option Replica Selection[] 
- A nested object resource.
- overrides
Sequence[GetInstance Autoscaling Config Asymmetric Autoscaling Option Override] 
- A nested object resource.
- replica_selections Sequence[GetInstance Autoscaling Config Asymmetric Autoscaling Option Replica Selection] 
- A nested object resource.
- overrides List<Property Map>
- A nested object resource.
- replicaSelections List<Property Map>
- A nested object resource.
GetInstanceAutoscalingConfigAsymmetricAutoscalingOptionOverride       
- AutoscalingLimits List<GetInstance Autoscaling Config Asymmetric Autoscaling Option Override Autoscaling Limit> 
- A nested object resource.
- AutoscalingLimits []GetInstance Autoscaling Config Asymmetric Autoscaling Option Override Autoscaling Limit 
- A nested object resource.
- autoscalingLimits List<GetInstance Autoscaling Config Asymmetric Autoscaling Option Override Autoscaling Limit> 
- A nested object resource.
- autoscalingLimits GetInstance Autoscaling Config Asymmetric Autoscaling Option Override Autoscaling Limit[] 
- A nested object resource.
- autoscalingLimits List<Property Map>
- A nested object resource.
GetInstanceAutoscalingConfigAsymmetricAutoscalingOptionOverrideAutoscalingLimit         
GetInstanceAutoscalingConfigAsymmetricAutoscalingOptionReplicaSelection        
- Location string
- The location of the replica to apply asymmetric autoscaling options.
- Location string
- The location of the replica to apply asymmetric autoscaling options.
- location String
- The location of the replica to apply asymmetric autoscaling options.
- location string
- The location of the replica to apply asymmetric autoscaling options.
- location str
- The location of the replica to apply asymmetric autoscaling options.
- location String
- The location of the replica to apply asymmetric autoscaling options.
GetInstanceAutoscalingConfigAutoscalingLimit     
- MaxNodes int
- Specifies maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes.
- MaxProcessing intUnits 
- Specifies maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units.
- MinNodes int
- Specifies number of nodes allocated to the instance. If set, this number should be greater than or equal to 1.
- MinProcessing intUnits 
- Specifies minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.
- MaxNodes int
- Specifies maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes.
- MaxProcessing intUnits 
- Specifies maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units.
- MinNodes int
- Specifies number of nodes allocated to the instance. If set, this number should be greater than or equal to 1.
- MinProcessing intUnits 
- Specifies minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.
- maxNodes Integer
- Specifies maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes.
- maxProcessing IntegerUnits 
- Specifies maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units.
- minNodes Integer
- Specifies number of nodes allocated to the instance. If set, this number should be greater than or equal to 1.
- minProcessing IntegerUnits 
- Specifies minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.
- maxNodes number
- Specifies maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes.
- maxProcessing numberUnits 
- Specifies maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units.
- minNodes number
- Specifies number of nodes allocated to the instance. If set, this number should be greater than or equal to 1.
- minProcessing numberUnits 
- Specifies minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.
- max_nodes int
- Specifies maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes.
- max_processing_ intunits 
- Specifies maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units.
- min_nodes int
- Specifies number of nodes allocated to the instance. If set, this number should be greater than or equal to 1.
- min_processing_ intunits 
- Specifies minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.
- maxNodes Number
- Specifies maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes.
- maxProcessing NumberUnits 
- Specifies maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units.
- minNodes Number
- Specifies number of nodes allocated to the instance. If set, this number should be greater than or equal to 1.
- minProcessing NumberUnits 
- Specifies minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.
GetInstanceAutoscalingConfigAutoscalingTarget     
- HighPriority intCpu Utilization Percent 
- Specifies the target high priority cpu utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization)..
- StorageUtilization intPercent 
- Specifies the target storage utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization).
- HighPriority intCpu Utilization Percent 
- Specifies the target high priority cpu utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization)..
- StorageUtilization intPercent 
- Specifies the target storage utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization).
- highPriority IntegerCpu Utilization Percent 
- Specifies the target high priority cpu utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization)..
- storageUtilization IntegerPercent 
- Specifies the target storage utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization).
- highPriority numberCpu Utilization Percent 
- Specifies the target high priority cpu utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization)..
- storageUtilization numberPercent 
- Specifies the target storage utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization).
- high_priority_ intcpu_ utilization_ percent 
- Specifies the target high priority cpu utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization)..
- storage_utilization_ intpercent 
- Specifies the target storage utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization).
- highPriority NumberCpu Utilization Percent 
- Specifies the target high priority cpu utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization)..
- storageUtilization NumberPercent 
- Specifies the target storage utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization).
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the google-betaTerraform Provider.