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

gcp.spanner.InstanceConfig

Explore with Pulumi AI

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

    A possible configuration for a Cloud Spanner instance. Configurations define the geographic placement of nodes and their replication.

    To get more information about InstanceConfig, see:

    Example Usage

    Create InstanceConfig Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new InstanceConfig(name: string, args: InstanceConfigArgs, opts?: CustomResourceOptions);
    @overload
    def InstanceConfig(resource_name: str,
                       args: InstanceConfigArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def InstanceConfig(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       display_name: Optional[str] = None,
                       replicas: Optional[Sequence[InstanceConfigReplicaArgs]] = None,
                       base_config: Optional[str] = None,
                       labels: Optional[Mapping[str, str]] = None,
                       name: Optional[str] = None,
                       project: Optional[str] = None)
    func NewInstanceConfig(ctx *Context, name string, args InstanceConfigArgs, opts ...ResourceOption) (*InstanceConfig, error)
    public InstanceConfig(string name, InstanceConfigArgs args, CustomResourceOptions? opts = null)
    public InstanceConfig(String name, InstanceConfigArgs args)
    public InstanceConfig(String name, InstanceConfigArgs args, CustomResourceOptions options)
    
    type: gcp:spanner:InstanceConfig
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args InstanceConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args InstanceConfigArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args InstanceConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InstanceConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InstanceConfigArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var instanceConfigResource = new Gcp.Spanner.InstanceConfig("instanceConfigResource", new()
    {
        DisplayName = "string",
        Replicas = new[]
        {
            new Gcp.Spanner.Inputs.InstanceConfigReplicaArgs
            {
                DefaultLeaderLocation = false,
                Location = "string",
                Type = "string",
            },
        },
        BaseConfig = "string",
        Labels = 
        {
            { "string", "string" },
        },
        Name = "string",
        Project = "string",
    });
    
    example, err := spanner.NewInstanceConfig(ctx, "instanceConfigResource", &spanner.InstanceConfigArgs{
    	DisplayName: pulumi.String("string"),
    	Replicas: spanner.InstanceConfigReplicaArray{
    		&spanner.InstanceConfigReplicaArgs{
    			DefaultLeaderLocation: pulumi.Bool(false),
    			Location:              pulumi.String("string"),
    			Type:                  pulumi.String("string"),
    		},
    	},
    	BaseConfig: pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name:    pulumi.String("string"),
    	Project: pulumi.String("string"),
    })
    
    var instanceConfigResource = new InstanceConfig("instanceConfigResource", InstanceConfigArgs.builder()
        .displayName("string")
        .replicas(InstanceConfigReplicaArgs.builder()
            .defaultLeaderLocation(false)
            .location("string")
            .type("string")
            .build())
        .baseConfig("string")
        .labels(Map.of("string", "string"))
        .name("string")
        .project("string")
        .build());
    
    instance_config_resource = gcp.spanner.InstanceConfig("instanceConfigResource",
        display_name="string",
        replicas=[{
            "default_leader_location": False,
            "location": "string",
            "type": "string",
        }],
        base_config="string",
        labels={
            "string": "string",
        },
        name="string",
        project="string")
    
    const instanceConfigResource = new gcp.spanner.InstanceConfig("instanceConfigResource", {
        displayName: "string",
        replicas: [{
            defaultLeaderLocation: false,
            location: "string",
            type: "string",
        }],
        baseConfig: "string",
        labels: {
            string: "string",
        },
        name: "string",
        project: "string",
    });
    
    type: gcp:spanner:InstanceConfig
    properties:
        baseConfig: string
        displayName: string
        labels:
            string: string
        name: string
        project: string
        replicas:
            - defaultLeaderLocation: false
              location: string
              type: string
    

    InstanceConfig Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The InstanceConfig resource accepts the following input properties:

    DisplayName string
    The name of this instance configuration as it appears in UIs.
    Replicas List<InstanceConfigReplica>
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    BaseConfig string
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    Labels Dictionary<string, string>
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    Name string
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    Project string
    DisplayName string
    The name of this instance configuration as it appears in UIs.
    Replicas []InstanceConfigReplicaArgs
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    BaseConfig string
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    Labels map[string]string
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    Name string
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    Project string
    displayName String
    The name of this instance configuration as it appears in UIs.
    replicas List<InstanceConfigReplica>
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    baseConfig String
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    labels Map<String,String>
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name String
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    project String
    displayName string
    The name of this instance configuration as it appears in UIs.
    replicas InstanceConfigReplica[]
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    baseConfig string
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    labels {[key: string]: string}
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name string
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    project string
    display_name str
    The name of this instance configuration as it appears in UIs.
    replicas Sequence[InstanceConfigReplicaArgs]
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    base_config str
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    labels Mapping[str, str]
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name str
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    project str
    displayName String
    The name of this instance configuration as it appears in UIs.
    replicas List<Property Map>
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    baseConfig String
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    labels Map<String>
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name String
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    project String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the InstanceConfig resource produces the following output properties:

    ConfigType string
    Output only. Whether this instance config is a Google or User Managed Configuration.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    ConfigType string
    Output only. Whether this instance config is a Google or User Managed Configuration.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    configType String
    Output only. Whether this instance config is a Google or User Managed Configuration.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    configType string
    Output only. Whether this instance config is a Google or User Managed Configuration.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id string
    The provider-assigned unique ID for this managed resource.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    config_type str
    Output only. Whether this instance config is a Google or User Managed Configuration.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id str
    The provider-assigned unique ID for this managed resource.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    configType String
    Output only. Whether this instance config is a Google or User Managed Configuration.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.

    Look up Existing InstanceConfig Resource

    Get an existing InstanceConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: InstanceConfigState, opts?: CustomResourceOptions): InstanceConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            base_config: Optional[str] = None,
            config_type: Optional[str] = None,
            display_name: Optional[str] = None,
            effective_labels: Optional[Mapping[str, str]] = None,
            labels: Optional[Mapping[str, str]] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            pulumi_labels: Optional[Mapping[str, str]] = None,
            replicas: Optional[Sequence[InstanceConfigReplicaArgs]] = None) -> InstanceConfig
    func GetInstanceConfig(ctx *Context, name string, id IDInput, state *InstanceConfigState, opts ...ResourceOption) (*InstanceConfig, error)
    public static InstanceConfig Get(string name, Input<string> id, InstanceConfigState? state, CustomResourceOptions? opts = null)
    public static InstanceConfig get(String name, Output<String> id, InstanceConfigState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    BaseConfig string
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    ConfigType string
    Output only. Whether this instance config is a Google or User Managed Configuration.
    DisplayName string
    The name of this instance configuration as it appears in UIs.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Labels Dictionary<string, string>
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    Name string
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    Project string
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    Replicas List<InstanceConfigReplica>
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    BaseConfig string
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    ConfigType string
    Output only. Whether this instance config is a Google or User Managed Configuration.
    DisplayName string
    The name of this instance configuration as it appears in UIs.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Labels map[string]string
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    Name string
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    Project string
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    Replicas []InstanceConfigReplicaArgs
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    baseConfig String
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    configType String
    Output only. Whether this instance config is a Google or User Managed Configuration.
    displayName String
    The name of this instance configuration as it appears in UIs.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels Map<String,String>
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name String
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    project String
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    replicas List<InstanceConfigReplica>
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    baseConfig string
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    configType string
    Output only. Whether this instance config is a Google or User Managed Configuration.
    displayName string
    The name of this instance configuration as it appears in UIs.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels {[key: string]: string}
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name string
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    project string
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    replicas InstanceConfigReplica[]
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    base_config str
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    config_type str
    Output only. Whether this instance config is a Google or User Managed Configuration.
    display_name str
    The name of this instance configuration as it appears in UIs.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels Mapping[str, str]
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name str
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    project str
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    replicas Sequence[InstanceConfigReplicaArgs]
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.
    baseConfig String
    Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this configuration.
    configType String
    Output only. Whether this instance config is a Google or User Managed Configuration.
    displayName String
    The name of this instance configuration as it appears in UIs.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels Map<String>
    An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name String
    A unique identifier for the instance configuration. Values are of the form projects//instanceConfigs/[a-z][-a-z0-9]*
    project String
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    replicas List<Property Map>
    The geographic placement of nodes in this instance configuration and their replication properties. Structure is documented below.

    Supporting Types

    InstanceConfigReplica, InstanceConfigReplicaArgs

    DefaultLeaderLocation bool
    If true, this location is designated as the default leader location where leader replicas are placed.


    Location string
    The location of the serving resources, e.g. "us-central1".
    Type string
    Indicates the type of replica. See the replica types documentation for more details. Possible values are: READ_WRITE, READ_ONLY, WITNESS.
    DefaultLeaderLocation bool
    If true, this location is designated as the default leader location where leader replicas are placed.


    Location string
    The location of the serving resources, e.g. "us-central1".
    Type string
    Indicates the type of replica. See the replica types documentation for more details. Possible values are: READ_WRITE, READ_ONLY, WITNESS.
    defaultLeaderLocation Boolean
    If true, this location is designated as the default leader location where leader replicas are placed.


    location String
    The location of the serving resources, e.g. "us-central1".
    type String
    Indicates the type of replica. See the replica types documentation for more details. Possible values are: READ_WRITE, READ_ONLY, WITNESS.
    defaultLeaderLocation boolean
    If true, this location is designated as the default leader location where leader replicas are placed.


    location string
    The location of the serving resources, e.g. "us-central1".
    type string
    Indicates the type of replica. See the replica types documentation for more details. Possible values are: READ_WRITE, READ_ONLY, WITNESS.
    default_leader_location bool
    If true, this location is designated as the default leader location where leader replicas are placed.


    location str
    The location of the serving resources, e.g. "us-central1".
    type str
    Indicates the type of replica. See the replica types documentation for more details. Possible values are: READ_WRITE, READ_ONLY, WITNESS.
    defaultLeaderLocation Boolean
    If true, this location is designated as the default leader location where leader replicas are placed.


    location String
    The location of the serving resources, e.g. "us-central1".
    type String
    Indicates the type of replica. See the replica types documentation for more details. Possible values are: READ_WRITE, READ_ONLY, WITNESS.

    Import

    InstanceConfig can be imported using any of these accepted formats:

    • projects/{{project}}/instanceConfigs/{{name}}

    • {{project}}/{{name}}

    • {{name}}

    When using the pulumi import command, InstanceConfig can be imported using one of the formats above. For example:

    $ pulumi import gcp:spanner/instanceConfig:InstanceConfig default projects/{{project}}/instanceConfigs/{{name}}
    
    $ pulumi import gcp:spanner/instanceConfig:InstanceConfig default {{project}}/{{name}}
    
    $ pulumi import gcp:spanner/instanceConfig:InstanceConfig default {{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    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