Instance

class Instance : KotlinCustomResource

A managed alloydb cluster instance. To get more information about Instance, see:

Example Usage

Alloydb Instance Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
import com.pulumi.gcp.alloydb.Cluster;
import com.pulumi.gcp.alloydb.ClusterArgs;
import com.pulumi.gcp.alloydb.inputs.ClusterInitialUserArgs;
import com.pulumi.gcp.compute.GlobalAddress;
import com.pulumi.gcp.compute.GlobalAddressArgs;
import com.pulumi.gcp.servicenetworking.Connection;
import com.pulumi.gcp.servicenetworking.ConnectionArgs;
import com.pulumi.gcp.alloydb.Instance;
import com.pulumi.gcp.alloydb.InstanceArgs;
import com.pulumi.gcp.alloydb.inputs.InstanceMachineConfigArgs;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.resources.CustomResourceOptions;
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 defaultNetwork = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
.name("alloydb-network")
.build());
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.clusterId("alloydb-cluster")
.location("us-central1")
.network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
.initialUser(ClusterInitialUserArgs.builder()
.password("alloydb-cluster")
.build())
.build());
var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()
.addressType("INTERNAL")
.purpose("VPC_PEERING")
.prefixLength(16)
.network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
.build());
var vpcConnection = new Connection("vpcConnection", ConnectionArgs.builder()
.network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(privateIpAlloc.name())
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.cluster(defaultCluster.name())
.instanceId("alloydb-instance")
.instanceType("PRIMARY")
.machineConfig(InstanceMachineConfigArgs.builder()
.cpuCount(2)
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(vpcConnection)
.build());
final var project = OrganizationsFunctions.getProject();
}
}

Import

Instance can be imported using any of these accepted formats

$ pulumi import gcp:alloydb/instance:Instance default projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/instances/{{instance_id}}
$ pulumi import gcp:alloydb/instance:Instance default {{project}}/{{location}}/{{cluster}}/{{instance_id}}
$ pulumi import gcp:alloydb/instance:Instance default {{location}}/{{cluster}}/{{instance_id}}

Properties

Link copied to clipboard
val annotations: Output<Map<String, String>>?

Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.

Link copied to clipboard

'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances. Note that primary and read instances can have different availability types. Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance. Zone is automatically chosen from the list of zones in the region specified. Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more can have regional availability (nodes are present in 2 or more zones in a region).' Possible values are: AVAILABILITY_TYPE_UNSPECIFIED, ZONAL, REGIONAL.

Link copied to clipboard
val cluster: Output<String>

Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'

Link copied to clipboard
val createTime: Output<String>

Time the Instance was created in UTC.

Link copied to clipboard
val databaseFlags: Output<Map<String, String>>?

Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary.

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

User-settable and human-readable display name for the Instance.

Link copied to clipboard
val gceZone: Output<String>?

The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val instanceId: Output<String>

The ID of the alloydb instance.

Link copied to clipboard
val instanceType: Output<String>

The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the depends_on meta-data attribute. Possible values are: PRIMARY, READ_POOL.

Link copied to clipboard
val ipAddress: Output<String>

The IP address for the Instance. This is the connection endpoint for an end-user application.

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

User-defined labels for the alloydb instance.

Link copied to clipboard

Configurations for the machines that host the underlying database engine. Structure is documented below.

Link copied to clipboard
val name: Output<String>

The name of the instance resource.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Read pool specific config. If the instance type is READ_POOL, this configuration must be provided. Structure is documented below.

Link copied to clipboard
val reconciling: Output<Boolean>

Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.

Link copied to clipboard
val state: Output<String>

The current state of the alloydb instance.

Link copied to clipboard
val uid: Output<String>

The system-generated UID of the resource.

Link copied to clipboard
val updateTime: Output<String>

Time the Instance was updated in UTC.

Link copied to clipboard
val urn: Output<String>