1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. spanner
  5. getInstance
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.spanner.getInstance

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    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)
    // 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:

    AutoscalingConfigs List<GetInstanceAutoscalingConfig>
    DefaultBackupScheduleType string
    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 []GetInstanceAutoscalingConfig
    DefaultBackupScheduleType string
    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<GetInstanceAutoscalingConfig>
    defaultBackupScheduleType String
    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 GetInstanceAutoscalingConfig[]
    defaultBackupScheduleType string
    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[GetInstanceAutoscalingConfig]
    default_backup_schedule_type str
    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>
    defaultBackupScheduleType String
    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

    AsymmetricAutoscalingOptions List<GetInstanceAutoscalingConfigAsymmetricAutoscalingOption>
    Asymmetric autoscaling options for specific replicas.
    AutoscalingLimits List<GetInstanceAutoscalingConfigAutoscalingLimit>
    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<GetInstanceAutoscalingConfigAutoscalingTarget>
    Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
    AsymmetricAutoscalingOptions []GetInstanceAutoscalingConfigAsymmetricAutoscalingOption
    Asymmetric autoscaling options for specific replicas.
    AutoscalingLimits []GetInstanceAutoscalingConfigAutoscalingLimit
    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 []GetInstanceAutoscalingConfigAutoscalingTarget
    Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
    asymmetricAutoscalingOptions List<GetInstanceAutoscalingConfigAsymmetricAutoscalingOption>
    Asymmetric autoscaling options for specific replicas.
    autoscalingLimits List<GetInstanceAutoscalingConfigAutoscalingLimit>
    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<GetInstanceAutoscalingConfigAutoscalingTarget>
    Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
    asymmetricAutoscalingOptions GetInstanceAutoscalingConfigAsymmetricAutoscalingOption[]
    Asymmetric autoscaling options for specific replicas.
    autoscalingLimits GetInstanceAutoscalingConfigAutoscalingLimit[]
    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 GetInstanceAutoscalingConfigAutoscalingTarget[]
    Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
    asymmetric_autoscaling_options Sequence[GetInstanceAutoscalingConfigAsymmetricAutoscalingOption]
    Asymmetric autoscaling options for specific replicas.
    autoscaling_limits Sequence[GetInstanceAutoscalingConfigAutoscalingLimit]
    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[GetInstanceAutoscalingConfigAutoscalingTarget]
    Defines scale in controls to reduce the risk of response latency and outages due to abrupt scale-in events
    asymmetricAutoscalingOptions List<Property Map>
    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<Property Map>
    A nested object resource.
    replicaSelections List<Property Map>
    A nested object resource.

    GetInstanceAutoscalingConfigAsymmetricAutoscalingOptionOverride

    autoscalingLimits List<Property Map>
    A nested object resource.

    GetInstanceAutoscalingConfigAsymmetricAutoscalingOptionOverrideAutoscalingLimit

    MaxNodes int
    The maximum number of nodes for this specific replica.
    MinNodes int
    The minimum number of nodes for this specific replica.
    MaxNodes int
    The maximum number of nodes for this specific replica.
    MinNodes int
    The minimum number of nodes for this specific replica.
    maxNodes Integer
    The maximum number of nodes for this specific replica.
    minNodes Integer
    The minimum number of nodes for this specific replica.
    maxNodes number
    The maximum number of nodes for this specific replica.
    minNodes number
    The minimum number of nodes for this specific replica.
    max_nodes int
    The maximum number of nodes for this specific replica.
    min_nodes int
    The minimum number of nodes for this specific replica.
    maxNodes Number
    The maximum number of nodes for this specific replica.
    minNodes Number
    The minimum number of nodes for this specific replica.

    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.
    MaxProcessingUnits int
    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.
    MinProcessingUnits int
    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.
    MaxProcessingUnits int
    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.
    MinProcessingUnits int
    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.
    maxProcessingUnits Integer
    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.
    minProcessingUnits Integer
    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.
    maxProcessingUnits number
    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.
    minProcessingUnits number
    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_units int
    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_units int
    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.
    maxProcessingUnits Number
    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.
    minProcessingUnits Number
    Specifies minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.

    GetInstanceAutoscalingConfigAutoscalingTarget

    HighPriorityCpuUtilizationPercent int
    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)..
    StorageUtilizationPercent int
    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).
    HighPriorityCpuUtilizationPercent int
    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)..
    StorageUtilizationPercent int
    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).
    highPriorityCpuUtilizationPercent Integer
    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)..
    storageUtilizationPercent Integer
    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).
    highPriorityCpuUtilizationPercent number
    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)..
    storageUtilizationPercent number
    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_cpu_utilization_percent int
    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_percent int
    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).
    highPriorityCpuUtilizationPercent Number
    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)..
    storageUtilizationPercent Number
    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-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi