Instance

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

$ 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}}

Properties

Link copied to clipboard
val config: Output<String>

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>

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>?

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 id: Output<String>
Link copied to clipboard
val labels: Output<Map<String, String>>?

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Link copied to clipboard
val name: Output<String>

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.

Link copied to clipboard
val numNodes: Output<Int>

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>

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>

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val state: Output<String>

Instance status: CREATING or READY.

Link copied to clipboard
val urn: Output<String>