InstanceArgs

data class InstanceArgs(val autoscalingConfig: Output<InstanceAutoscalingConfigArgs>? = null, val config: Output<String>? = null, val displayName: Output<String>? = null, val forceDestroy: Output<Boolean>? = null, val labels: Output<Map<String, String>>? = null, val name: Output<String>? = null, val numNodes: Output<Int>? = null, val processingUnits: Output<Int>? = null, val project: Output<String>? = null) : ConvertibleToJava<InstanceArgs>

An isolated set of Cloud Spanner resources on which databases can be hosted. To get more information about Instance, see:

Example Usage

Spanner Instance Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.spanner.Instance;
import com.pulumi.gcp.spanner.InstanceArgs;
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) {
var example = new Instance("example", InstanceArgs.builder()
.config("regional-us-central1")
.displayName("Test Spanner Instance")
.labels(Map.of("foo", "bar"))
.numNodes(2)
.build());
}
}

Spanner Instance Processing Units

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.spanner.Instance;
import com.pulumi.gcp.spanner.InstanceArgs;
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) {
var example = new Instance("example", InstanceArgs.builder()
.config("regional-us-central1")
.displayName("Test Spanner Instance")
.labels(Map.of("foo", "bar"))
.processingUnits(200)
.build());
}
}

Spanner Instance Multi Regional

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.spanner.Instance;
import com.pulumi.gcp.spanner.InstanceArgs;
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) {
var example = new Instance("example", InstanceArgs.builder()
.config("nam-eur-asia1")
.displayName("Multi Regional Instance")
.labels(Map.of("foo", "bar"))
.numNodes(2)
.build());
}
}

Import

Instance can be imported using any of these accepted formats* projects/{{project}}/instances/{{name}} * {{project}}/{{name}} * {{name}} In Terraform v1.5.0 and later, use an import block to import Instance using one of the formats above. For exampletf import { id = "projects/{{project}}/instances/{{name}}" to = google_spanner_instance.default }

$ pulumi import gcp:spanner/instance:Instance When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Instance can be imported using one of the formats above. For example
$ pulumi import gcp:spanner/instance:Instance default projects/{{project}}/instances/{{name}}
$ pulumi import gcp:spanner/instance:Instance default {{project}}/{{name}}
$ pulumi import gcp:spanner/instance:Instance default {{name}}

Constructors

Link copied to clipboard
fun InstanceArgs(autoscalingConfig: Output<InstanceAutoscalingConfigArgs>? = null, config: Output<String>? = null, displayName: Output<String>? = null, forceDestroy: Output<Boolean>? = null, labels: Output<Map<String, String>>? = null, name: Output<String>? = null, numNodes: Output<Int>? = null, processingUnits: Output<Int>? = null, project: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): InstanceArgs

Properties

Link copied to clipboard

The autoscaling configuration. Autoscaling is enabled if this field is set. When autoscaling is enabled, num_nodes and processing_units are treated as, OUTPUT_ONLY fields and reflect the current compute capacity allocated to the instance. Structure is documented below.

Link copied to clipboard
val config: Output<String>? = null

The name of the instance's configuration (similar but not quite the same as a region) which defines the geographic placement and replication of your databases in this instance. It determines where your data is stored. Values are typically of the form regional-europe-west1 , us-central etc. In order to obtain a valid list please consult the Configuration section of the docs.

Link copied to clipboard
val displayName: Output<String>? = null

The descriptive name for this instance as it appears in UIs. Must be unique per project and between 4 and 30 characters in length.

Link copied to clipboard
val forceDestroy: Output<Boolean>? = null

When deleting a spanner instance, this boolean option will delete all backups of this instance. This must be set to true if you created a backup manually in the console.

Link copied to clipboard
val labels: Output<Map<String, String>>? = null

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.

Link copied to clipboard
val name: Output<String>? = null

A unique identifier for the instance, which cannot be changed after the instance is created. The name must be between 6 and 30 characters in length. If not provided, a random string starting with tf- will be selected.

Link copied to clipboard
val numNodes: Output<Int>? = null

The number of nodes allocated to this instance. Exactly one of either node_count or processing_units must be present in terraform.

Link copied to clipboard
val processingUnits: Output<Int>? = null

The number of processing units allocated to this instance. Exactly one of processing_units or node_count must be present in terraform.

Link copied to clipboard
val project: Output<String>? = null

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