com.pulumi.gcp.spanner.kotlin.InstanceArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.spanner.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.spanner.InstanceArgs.builder
import com.pulumi.gcp.spanner.kotlin.inputs.InstanceAutoscalingConfigArgs
import com.pulumi.gcp.spanner.kotlin.inputs.InstanceAutoscalingConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* An isolated set of Cloud Spanner resources on which databases can be
* hosted.
* To get more information about Instance, see:
* * [API documentation](https://cloud.google.com/spanner/docs/reference/rest/v1/projects.instances)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/spanner/)
* ## Example Usage
* ### Spanner Instance Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const example = new gcp.spanner.Instance("example", {
* config: "regional-us-central1",
* displayName: "Test Spanner Instance",
* numNodes: 2,
* labels: {
* foo: "bar",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.spanner.Instance("example",
* config="regional-us-central1",
* display_name="Test Spanner Instance",
* num_nodes=2,
* labels={
* "foo": "bar",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var example = new Gcp.Spanner.Instance("example", new()
* {
* Config = "regional-us-central1",
* DisplayName = "Test Spanner Instance",
* NumNodes = 2,
* Labels =
* {
* { "foo", "bar" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/spanner"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := spanner.NewInstance(ctx, "example", &spanner.InstanceArgs{
* Config: pulumi.String("regional-us-central1"),
* DisplayName: pulumi.String("Test Spanner Instance"),
* NumNodes: pulumi.Int(2),
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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")
* .numNodes(2)
* .labels(Map.of("foo", "bar"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:spanner:Instance
* properties:
* config: regional-us-central1
* displayName: Test Spanner Instance
* numNodes: 2
* labels:
* foo: bar
* ```
*
* ### Spanner Instance Processing Units
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const example = new gcp.spanner.Instance("example", {
* config: "regional-us-central1",
* displayName: "Test Spanner Instance",
* processingUnits: 200,
* labels: {
* foo: "bar",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.spanner.Instance("example",
* config="regional-us-central1",
* display_name="Test Spanner Instance",
* processing_units=200,
* labels={
* "foo": "bar",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var example = new Gcp.Spanner.Instance("example", new()
* {
* Config = "regional-us-central1",
* DisplayName = "Test Spanner Instance",
* ProcessingUnits = 200,
* Labels =
* {
* { "foo", "bar" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/spanner"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := spanner.NewInstance(ctx, "example", &spanner.InstanceArgs{
* Config: pulumi.String("regional-us-central1"),
* DisplayName: pulumi.String("Test Spanner Instance"),
* ProcessingUnits: pulumi.Int(200),
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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")
* .processingUnits(200)
* .labels(Map.of("foo", "bar"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:spanner:Instance
* properties:
* config: regional-us-central1
* displayName: Test Spanner Instance
* processingUnits: 200
* labels:
* foo: bar
* ```
*
* ### Spanner Instance With Autoscaling
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const example = new gcp.spanner.Instance("example", {
* config: "regional-us-central1",
* displayName: "Test Spanner Instance",
* autoscalingConfig: {
* autoscalingLimits: {
* maxProcessingUnits: 3000,
* minProcessingUnits: 2000,
* },
* autoscalingTargets: {
* highPriorityCpuUtilizationPercent: 75,
* storageUtilizationPercent: 90,
* },
* },
* labels: {
* foo: "bar",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.spanner.Instance("example",
* config="regional-us-central1",
* display_name="Test Spanner Instance",
* autoscaling_config=gcp.spanner.InstanceAutoscalingConfigArgs(
* autoscaling_limits=gcp.spanner.InstanceAutoscalingConfigAutoscalingLimitsArgs(
* max_processing_units=3000,
* min_processing_units=2000,
* ),
* autoscaling_targets=gcp.spanner.InstanceAutoscalingConfigAutoscalingTargetsArgs(
* high_priority_cpu_utilization_percent=75,
* storage_utilization_percent=90,
* ),
* ),
* labels={
* "foo": "bar",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var example = new Gcp.Spanner.Instance("example", new()
* {
* Config = "regional-us-central1",
* DisplayName = "Test Spanner Instance",
* AutoscalingConfig = new Gcp.Spanner.Inputs.InstanceAutoscalingConfigArgs
* {
* AutoscalingLimits = new Gcp.Spanner.Inputs.InstanceAutoscalingConfigAutoscalingLimitsArgs
* {
* MaxProcessingUnits = 3000,
* MinProcessingUnits = 2000,
* },
* AutoscalingTargets = new Gcp.Spanner.Inputs.InstanceAutoscalingConfigAutoscalingTargetsArgs
* {
* HighPriorityCpuUtilizationPercent = 75,
* StorageUtilizationPercent = 90,
* },
* },
* Labels =
* {
* { "foo", "bar" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/spanner"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := spanner.NewInstance(ctx, "example", &spanner.InstanceArgs{
* Config: pulumi.String("regional-us-central1"),
* DisplayName: pulumi.String("Test Spanner Instance"),
* AutoscalingConfig: &spanner.InstanceAutoscalingConfigArgs{
* AutoscalingLimits: &spanner.InstanceAutoscalingConfigAutoscalingLimitsArgs{
* MaxProcessingUnits: pulumi.Int(3000),
* MinProcessingUnits: pulumi.Int(2000),
* },
* AutoscalingTargets: &spanner.InstanceAutoscalingConfigAutoscalingTargetsArgs{
* HighPriorityCpuUtilizationPercent: pulumi.Int(75),
* StorageUtilizationPercent: pulumi.Int(90),
* },
* },
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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 com.pulumi.gcp.spanner.inputs.InstanceAutoscalingConfigArgs;
* import com.pulumi.gcp.spanner.inputs.InstanceAutoscalingConfigAutoscalingLimitsArgs;
* import com.pulumi.gcp.spanner.inputs.InstanceAutoscalingConfigAutoscalingTargetsArgs;
* 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")
* .autoscalingConfig(InstanceAutoscalingConfigArgs.builder()
* .autoscalingLimits(InstanceAutoscalingConfigAutoscalingLimitsArgs.builder()
* .maxProcessingUnits(3000)
* .minProcessingUnits(2000)
* .build())
* .autoscalingTargets(InstanceAutoscalingConfigAutoscalingTargetsArgs.builder()
* .highPriorityCpuUtilizationPercent(75)
* .storageUtilizationPercent(90)
* .build())
* .build())
* .labels(Map.of("foo", "bar"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:spanner:Instance
* properties:
* config: regional-us-central1
* displayName: Test Spanner Instance
* autoscalingConfig:
* autoscalingLimits:
* maxProcessingUnits: 3000
* minProcessingUnits: 2000
* autoscalingTargets:
* highPriorityCpuUtilizationPercent: 75
* storageUtilizationPercent: 90
* labels:
* foo: bar
* ```
*
* ### Spanner Instance Multi Regional
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const example = new gcp.spanner.Instance("example", {
* config: "nam-eur-asia1",
* displayName: "Multi Regional Instance",
* numNodes: 2,
* labels: {
* foo: "bar",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.spanner.Instance("example",
* config="nam-eur-asia1",
* display_name="Multi Regional Instance",
* num_nodes=2,
* labels={
* "foo": "bar",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var example = new Gcp.Spanner.Instance("example", new()
* {
* Config = "nam-eur-asia1",
* DisplayName = "Multi Regional Instance",
* NumNodes = 2,
* Labels =
* {
* { "foo", "bar" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/spanner"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := spanner.NewInstance(ctx, "example", &spanner.InstanceArgs{
* Config: pulumi.String("nam-eur-asia1"),
* DisplayName: pulumi.String("Multi Regional Instance"),
* NumNodes: pulumi.Int(2),
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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")
* .numNodes(2)
* .labels(Map.of("foo", "bar"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:spanner:Instance
* properties:
* config: nam-eur-asia1
* displayName: Multi Regional Instance
* numNodes: 2
* labels:
* foo: bar
* ```
*
* ## Import
* Instance can be imported using any of these accepted formats:
* * `projects/{{project}}/instances/{{name}}`
* * `{{project}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, Instance can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:spanner/instance:Instance default projects/{{project}}/instances/{{name}}
* ```
* ```sh
* $ pulumi import gcp:spanner/instance:Instance default {{project}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:spanner/instance:Instance default {{name}}
* ```
* @property autoscalingConfig 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.
* @property config 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](https://cloud.google.com/spanner/docs/instances).
* @property displayName The descriptive name for this instance as it appears in UIs. Must be
* unique per project and between 4 and 30 characters in length.
* - - -
* @property forceDestroy 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.
* @property labels 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.
* @property name 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.
* @property numNodes
* @property processingUnits
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
public data class InstanceArgs(
public val autoscalingConfig: Output? = null,
public val config: Output? = null,
public val displayName: Output? = null,
public val forceDestroy: Output? = null,
public val labels: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy