gcp.alloydb.Instance
Explore with Pulumi AI
A managed alloydb cluster instance.
To get more information about Instance, see:
- API documentation
- How-to Guides
Example Usage
Alloydb Instance Basic
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var project = Gcp.Organizations.GetProject.Invoke();
var defaultNetwork = new Gcp.Compute.Network("defaultNetwork");
var defaultCluster = new Gcp.Alloydb.Cluster("defaultCluster", new()
{
ClusterId = "alloydb-cluster",
Location = "us-central1",
Network = Output.Tuple(project, defaultNetwork.Name).Apply(values =>
{
var project = values.Item1;
var name = values.Item2;
return $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}/global/networks/{name}";
}),
InitialUser = new Gcp.Alloydb.Inputs.ClusterInitialUserArgs
{
Password = "alloydb-cluster",
},
});
var privateIpAlloc = new Gcp.Compute.GlobalAddress("privateIpAlloc", new()
{
AddressType = "INTERNAL",
Purpose = "VPC_PEERING",
PrefixLength = 16,
Network = defaultNetwork.Id,
});
var vpcConnection = new Gcp.ServiceNetworking.Connection("vpcConnection", new()
{
Network = defaultNetwork.Id,
Service = "servicenetworking.googleapis.com",
ReservedPeeringRanges = new[]
{
privateIpAlloc.Name,
},
});
var defaultInstance = new Gcp.Alloydb.Instance("defaultInstance", new()
{
Cluster = defaultCluster.Name,
InstanceId = "alloydb-instance",
InstanceType = "PRIMARY",
MachineConfig = new Gcp.Alloydb.Inputs.InstanceMachineConfigArgs
{
CpuCount = 2,
},
}, new CustomResourceOptions
{
DependsOn = new[]
{
vpcConnection,
},
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/alloydb"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/servicenetworking"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
project, err := organizations.LookupProject(ctx, nil, nil)
if err != nil {
return err
}
defaultNetwork, err := compute.NewNetwork(ctx, "defaultNetwork", nil)
if err != nil {
return err
}
defaultCluster, err := alloydb.NewCluster(ctx, "defaultCluster", &alloydb.ClusterArgs{
ClusterId: pulumi.String("alloydb-cluster"),
Location: pulumi.String("us-central1"),
Network: defaultNetwork.Name.ApplyT(func(name string) (string, error) {
return fmt.Sprintf("projects/%v/global/networks/%v", project.Number, name), nil
}).(pulumi.StringOutput),
InitialUser: &alloydb.ClusterInitialUserArgs{
Password: pulumi.String("alloydb-cluster"),
},
})
if err != nil {
return err
}
privateIpAlloc, err := compute.NewGlobalAddress(ctx, "privateIpAlloc", &compute.GlobalAddressArgs{
AddressType: pulumi.String("INTERNAL"),
Purpose: pulumi.String("VPC_PEERING"),
PrefixLength: pulumi.Int(16),
Network: defaultNetwork.ID(),
})
if err != nil {
return err
}
vpcConnection, err := servicenetworking.NewConnection(ctx, "vpcConnection", &servicenetworking.ConnectionArgs{
Network: defaultNetwork.ID(),
Service: pulumi.String("servicenetworking.googleapis.com"),
ReservedPeeringRanges: pulumi.StringArray{
privateIpAlloc.Name,
},
})
if err != nil {
return err
}
_, err = alloydb.NewInstance(ctx, "defaultInstance", &alloydb.InstanceArgs{
Cluster: defaultCluster.Name,
InstanceId: pulumi.String("alloydb-instance"),
InstanceType: pulumi.String("PRIMARY"),
MachineConfig: &alloydb.InstanceMachineConfigArgs{
CpuCount: pulumi.Int(2),
},
}, pulumi.DependsOn([]pulumi.Resource{
vpcConnection,
}))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.compute.Network;
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.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 project = OrganizationsFunctions.getProject();
var defaultNetwork = new Network("defaultNetwork");
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.clusterId("alloydb-cluster")
.location("us-central1")
.network(defaultNetwork.name().applyValue(name -> String.format("projects/%s/global/networks/%s", project.applyValue(getProjectResult -> getProjectResult.number()),name)))
.initialUser(ClusterInitialUserArgs.builder()
.password("alloydb-cluster")
.build())
.build());
var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()
.addressType("INTERNAL")
.purpose("VPC_PEERING")
.prefixLength(16)
.network(defaultNetwork.id())
.build());
var vpcConnection = new Connection("vpcConnection", ConnectionArgs.builder()
.network(defaultNetwork.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());
}
}
import pulumi
import pulumi_gcp as gcp
project = gcp.organizations.get_project()
default_network = gcp.compute.Network("defaultNetwork")
default_cluster = gcp.alloydb.Cluster("defaultCluster",
cluster_id="alloydb-cluster",
location="us-central1",
network=default_network.name.apply(lambda name: f"projects/{project.number}/global/networks/{name}"),
initial_user=gcp.alloydb.ClusterInitialUserArgs(
password="alloydb-cluster",
))
private_ip_alloc = gcp.compute.GlobalAddress("privateIpAlloc",
address_type="INTERNAL",
purpose="VPC_PEERING",
prefix_length=16,
network=default_network.id)
vpc_connection = gcp.servicenetworking.Connection("vpcConnection",
network=default_network.id,
service="servicenetworking.googleapis.com",
reserved_peering_ranges=[private_ip_alloc.name])
default_instance = gcp.alloydb.Instance("defaultInstance",
cluster=default_cluster.name,
instance_id="alloydb-instance",
instance_type="PRIMARY",
machine_config=gcp.alloydb.InstanceMachineConfigArgs(
cpu_count=2,
),
opts=pulumi.ResourceOptions(depends_on=[vpc_connection]))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const project = gcp.organizations.getProject({});
const defaultNetwork = new gcp.compute.Network("defaultNetwork", {});
const defaultCluster = new gcp.alloydb.Cluster("defaultCluster", {
clusterId: "alloydb-cluster",
location: "us-central1",
network: pulumi.all([project, defaultNetwork.name]).apply(([project, name]) => `projects/${project.number}/global/networks/${name}`),
initialUser: {
password: "alloydb-cluster",
},
});
const privateIpAlloc = new gcp.compute.GlobalAddress("privateIpAlloc", {
addressType: "INTERNAL",
purpose: "VPC_PEERING",
prefixLength: 16,
network: defaultNetwork.id,
});
const vpcConnection = new gcp.servicenetworking.Connection("vpcConnection", {
network: defaultNetwork.id,
service: "servicenetworking.googleapis.com",
reservedPeeringRanges: [privateIpAlloc.name],
});
const defaultInstance = new gcp.alloydb.Instance("defaultInstance", {
cluster: defaultCluster.name,
instanceId: "alloydb-instance",
instanceType: "PRIMARY",
machineConfig: {
cpuCount: 2,
},
}, {
dependsOn: [vpcConnection],
});
resources:
defaultInstance:
type: gcp:alloydb:Instance
properties:
cluster: ${defaultCluster.name}
instanceId: alloydb-instance
instanceType: PRIMARY
machineConfig:
cpuCount: 2
options:
dependson:
- ${vpcConnection}
defaultCluster:
type: gcp:alloydb:Cluster
properties:
clusterId: alloydb-cluster
location: us-central1
network: projects/${project.number}/global/networks/${defaultNetwork.name}
initialUser:
password: alloydb-cluster
defaultNetwork:
type: gcp:compute:Network
privateIpAlloc:
type: gcp:compute:GlobalAddress
properties:
addressType: INTERNAL
purpose: VPC_PEERING
prefixLength: 16
network: ${defaultNetwork.id}
vpcConnection:
type: gcp:servicenetworking:Connection
properties:
network: ${defaultNetwork.id}
service: servicenetworking.googleapis.com
reservedPeeringRanges:
- ${privateIpAlloc.name}
variables:
project:
fn::invoke:
Function: gcp:organizations:getProject
Arguments: {}
Create Instance Resource
new Instance(name: string, args: InstanceArgs, opts?: CustomResourceOptions);
@overload
def Instance(resource_name: str,
opts: Optional[ResourceOptions] = None,
annotations: Optional[Mapping[str, str]] = None,
availability_type: Optional[str] = None,
cluster: Optional[str] = None,
database_flags: Optional[Mapping[str, str]] = None,
display_name: Optional[str] = None,
gce_zone: Optional[str] = None,
instance_id: Optional[str] = None,
instance_type: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
machine_config: Optional[InstanceMachineConfigArgs] = None,
read_pool_config: Optional[InstanceReadPoolConfigArgs] = None)
@overload
def Instance(resource_name: str,
args: InstanceArgs,
opts: Optional[ResourceOptions] = None)
func NewInstance(ctx *Context, name string, args InstanceArgs, opts ...ResourceOption) (*Instance, error)
public Instance(string name, InstanceArgs args, CustomResourceOptions? opts = null)
public Instance(String name, InstanceArgs args)
public Instance(String name, InstanceArgs args, CustomResourceOptions options)
type: gcp:alloydb:Instance
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceArgs
- 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 InstanceArgs
- 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 InstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InstanceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Instance Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Instance resource accepts the following input properties:
- Cluster string
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- Instance
Id string The ID of the alloydb instance.
- Instance
Type 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
.- Annotations Dictionary<string, string>
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- Availability
Type string 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- Database
Flags Dictionary<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.
- Display
Name string User-settable and human-readable display name for the Instance.
- Gce
Zone 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.
- Labels Dictionary<string, string>
User-defined labels for the alloydb instance.
- Machine
Config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- Read
Pool InstanceConfig Read Pool Config Args Read pool specific config. Structure is documented below.
- Cluster string
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- Instance
Id string The ID of the alloydb instance.
- Instance
Type 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
.- Annotations map[string]string
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- Availability
Type string 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- Database
Flags 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.
- Display
Name string User-settable and human-readable display name for the Instance.
- Gce
Zone 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.
- Labels map[string]string
User-defined labels for the alloydb instance.
- Machine
Config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- Read
Pool InstanceConfig Read Pool Config Args Read pool specific config. Structure is documented below.
- cluster String
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- instance
Id String The ID of the alloydb instance.
- instance
Type 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
.- annotations Map<String,String>
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- availability
Type String 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- database
Flags 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.
- display
Name String User-settable and human-readable display name for the Instance.
- gce
Zone 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.
- labels Map<String,String>
User-defined labels for the alloydb instance.
- machine
Config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- read
Pool InstanceConfig Read Pool Config Args Read pool specific config. Structure is documented below.
- cluster string
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- instance
Id string The ID of the alloydb instance.
- instance
Type 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
.- annotations {[key: string]: string}
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- availability
Type string 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- database
Flags {[key: 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.
- display
Name string User-settable and human-readable display name for the Instance.
- gce
Zone 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.
- labels {[key: string]: string}
User-defined labels for the alloydb instance.
- machine
Config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- read
Pool InstanceConfig Read Pool Config Args Read pool specific config. Structure is documented below.
- cluster str
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- instance_
id str The ID of the alloydb instance.
- instance_
type str 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
.- annotations Mapping[str, str]
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- availability_
type str 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- database_
flags Mapping[str, str] 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.
- display_
name str User-settable and human-readable display name for the Instance.
- gce_
zone str 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.
- labels Mapping[str, str]
User-defined labels for the alloydb instance.
- machine_
config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- read_
pool_ Instanceconfig Read Pool Config Args Read pool specific config. Structure is documented below.
- cluster String
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- instance
Id String The ID of the alloydb instance.
- instance
Type 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
.- annotations Map<String>
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- availability
Type String 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- database
Flags Map<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.
- display
Name String User-settable and human-readable display name for the Instance.
- gce
Zone 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.
- labels Map<String>
User-defined labels for the alloydb instance.
- machine
Config Property Map Configurations for the machines that host the underlying database engine. Structure is documented below.
- read
Pool Property MapConfig Read pool specific config. Structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the Instance resource produces the following output properties:
- Create
Time string Time the Instance was created in UTC.
- Id string
The provider-assigned unique ID for this managed resource.
- Ip
Address string The IP address for the Instance. This is the connection endpoint for an end-user application.
- Name string
The name of the instance resource.
- Reconciling bool
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.
- State string
The current state of the alloydb instance.
- Uid string
The system-generated UID of the resource.
- Update
Time string Time the Instance was updated in UTC.
- Create
Time string Time the Instance was created in UTC.
- Id string
The provider-assigned unique ID for this managed resource.
- Ip
Address string The IP address for the Instance. This is the connection endpoint for an end-user application.
- Name string
The name of the instance resource.
- Reconciling bool
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.
- State string
The current state of the alloydb instance.
- Uid string
The system-generated UID of the resource.
- Update
Time string Time the Instance was updated in UTC.
- create
Time String Time the Instance was created in UTC.
- id String
The provider-assigned unique ID for this managed resource.
- ip
Address String The IP address for the Instance. This is the connection endpoint for an end-user application.
- name String
The name of the instance resource.
- reconciling 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.
- state String
The current state of the alloydb instance.
- uid String
The system-generated UID of the resource.
- update
Time String Time the Instance was updated in UTC.
- create
Time string Time the Instance was created in UTC.
- id string
The provider-assigned unique ID for this managed resource.
- ip
Address string The IP address for the Instance. This is the connection endpoint for an end-user application.
- name string
The name of the instance resource.
- reconciling 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.
- state string
The current state of the alloydb instance.
- uid string
The system-generated UID of the resource.
- update
Time string Time the Instance was updated in UTC.
- create_
time str Time the Instance was created in UTC.
- id str
The provider-assigned unique ID for this managed resource.
- ip_
address str The IP address for the Instance. This is the connection endpoint for an end-user application.
- name str
The name of the instance resource.
- reconciling bool
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.
- state str
The current state of the alloydb instance.
- uid str
The system-generated UID of the resource.
- update_
time str Time the Instance was updated in UTC.
- create
Time String Time the Instance was created in UTC.
- id String
The provider-assigned unique ID for this managed resource.
- ip
Address String The IP address for the Instance. This is the connection endpoint for an end-user application.
- name String
The name of the instance resource.
- reconciling 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.
- state String
The current state of the alloydb instance.
- uid String
The system-generated UID of the resource.
- update
Time String Time the Instance was updated in UTC.
Look up Existing Instance Resource
Get an existing Instance 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?: InstanceState, opts?: CustomResourceOptions): Instance
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
annotations: Optional[Mapping[str, str]] = None,
availability_type: Optional[str] = None,
cluster: Optional[str] = None,
create_time: Optional[str] = None,
database_flags: Optional[Mapping[str, str]] = None,
display_name: Optional[str] = None,
gce_zone: Optional[str] = None,
instance_id: Optional[str] = None,
instance_type: Optional[str] = None,
ip_address: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
machine_config: Optional[InstanceMachineConfigArgs] = None,
name: Optional[str] = None,
read_pool_config: Optional[InstanceReadPoolConfigArgs] = None,
reconciling: Optional[bool] = None,
state: Optional[str] = None,
uid: Optional[str] = None,
update_time: Optional[str] = None) -> Instance
func GetInstance(ctx *Context, name string, id IDInput, state *InstanceState, opts ...ResourceOption) (*Instance, error)
public static Instance Get(string name, Input<string> id, InstanceState? state, CustomResourceOptions? opts = null)
public static Instance get(String name, Output<String> id, InstanceState 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.
- Annotations Dictionary<string, string>
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- Availability
Type string 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- Cluster string
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- Create
Time string Time the Instance was created in UTC.
- Database
Flags Dictionary<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.
- Display
Name string User-settable and human-readable display name for the Instance.
- Gce
Zone 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.
- Instance
Id string The ID of the alloydb instance.
- Instance
Type 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
.- Ip
Address string The IP address for the Instance. This is the connection endpoint for an end-user application.
- Labels Dictionary<string, string>
User-defined labels for the alloydb instance.
- Machine
Config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- Name string
The name of the instance resource.
- Read
Pool InstanceConfig Read Pool Config Args Read pool specific config. Structure is documented below.
- Reconciling bool
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.
- State string
The current state of the alloydb instance.
- Uid string
The system-generated UID of the resource.
- Update
Time string Time the Instance was updated in UTC.
- Annotations map[string]string
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- Availability
Type string 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- Cluster string
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- Create
Time string Time the Instance was created in UTC.
- Database
Flags 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.
- Display
Name string User-settable and human-readable display name for the Instance.
- Gce
Zone 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.
- Instance
Id string The ID of the alloydb instance.
- Instance
Type 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
.- Ip
Address string The IP address for the Instance. This is the connection endpoint for an end-user application.
- Labels map[string]string
User-defined labels for the alloydb instance.
- Machine
Config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- Name string
The name of the instance resource.
- Read
Pool InstanceConfig Read Pool Config Args Read pool specific config. Structure is documented below.
- Reconciling bool
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.
- State string
The current state of the alloydb instance.
- Uid string
The system-generated UID of the resource.
- Update
Time string Time the Instance was updated in UTC.
- annotations Map<String,String>
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- availability
Type String 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- cluster String
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- create
Time String Time the Instance was created in UTC.
- database
Flags 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.
- display
Name String User-settable and human-readable display name for the Instance.
- gce
Zone 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.
- instance
Id String The ID of the alloydb instance.
- instance
Type 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
.- ip
Address String The IP address for the Instance. This is the connection endpoint for an end-user application.
- labels Map<String,String>
User-defined labels for the alloydb instance.
- machine
Config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- name String
The name of the instance resource.
- read
Pool InstanceConfig Read Pool Config Args Read pool specific config. Structure is documented below.
- reconciling 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.
- state String
The current state of the alloydb instance.
- uid String
The system-generated UID of the resource.
- update
Time String Time the Instance was updated in UTC.
- annotations {[key: string]: string}
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- availability
Type string 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- cluster string
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- create
Time string Time the Instance was created in UTC.
- database
Flags {[key: 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.
- display
Name string User-settable and human-readable display name for the Instance.
- gce
Zone 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.
- instance
Id string The ID of the alloydb instance.
- instance
Type 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
.- ip
Address string The IP address for the Instance. This is the connection endpoint for an end-user application.
- labels {[key: string]: string}
User-defined labels for the alloydb instance.
- machine
Config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- name string
The name of the instance resource.
- read
Pool InstanceConfig Read Pool Config Args Read pool specific config. Structure is documented below.
- reconciling 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.
- state string
The current state of the alloydb instance.
- uid string
The system-generated UID of the resource.
- update
Time string Time the Instance was updated in UTC.
- annotations Mapping[str, str]
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- availability_
type str 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- cluster str
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- create_
time str Time the Instance was created in UTC.
- database_
flags Mapping[str, str] 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.
- display_
name str User-settable and human-readable display name for the Instance.
- gce_
zone str 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.
- instance_
id str The ID of the alloydb instance.
- instance_
type str 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
.- ip_
address str The IP address for the Instance. This is the connection endpoint for an end-user application.
- labels Mapping[str, str]
User-defined labels for the alloydb instance.
- machine_
config InstanceMachine Config Args Configurations for the machines that host the underlying database engine. Structure is documented below.
- name str
The name of the instance resource.
- read_
pool_ Instanceconfig Read Pool Config Args Read pool specific config. Structure is documented below.
- reconciling bool
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.
- state str
The current state of the alloydb instance.
- uid str
The system-generated UID of the resource.
- update_
time str Time the Instance was updated in UTC.
- annotations Map<String>
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
- availability
Type String 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. Possible values are:
AVAILABILITY_TYPE_UNSPECIFIED
,ZONAL
,REGIONAL
.- cluster String
Identifies the alloydb cluster. Must be in the format 'projects/{project}/locations/{location}/clusters/{cluster_id}'
- create
Time String Time the Instance was created in UTC.
- database
Flags Map<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.
- display
Name String User-settable and human-readable display name for the Instance.
- gce
Zone 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.
- instance
Id String The ID of the alloydb instance.
- instance
Type 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
.- ip
Address String The IP address for the Instance. This is the connection endpoint for an end-user application.
- labels Map<String>
User-defined labels for the alloydb instance.
- machine
Config Property Map Configurations for the machines that host the underlying database engine. Structure is documented below.
- name String
The name of the instance resource.
- read
Pool Property MapConfig Read pool specific config. Structure is documented below.
- reconciling 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.
- state String
The current state of the alloydb instance.
- uid String
The system-generated UID of the resource.
- update
Time String Time the Instance was updated in UTC.
Supporting Types
InstanceMachineConfig
- Cpu
Count int The number of CPU's in the VM instance.
- Cpu
Count int The number of CPU's in the VM instance.
- cpu
Count Integer The number of CPU's in the VM instance.
- cpu
Count number The number of CPU's in the VM instance.
- cpu_
count int The number of CPU's in the VM instance.
- cpu
Count Number The number of CPU's in the VM instance.
InstanceReadPoolConfig
- Node
Count int Read capacity, i.e. number of nodes in a read pool instance.
- Node
Count int Read capacity, i.e. number of nodes in a read pool instance.
- node
Count Integer Read capacity, i.e. number of nodes in a read pool instance.
- node
Count number Read capacity, i.e. number of nodes in a read pool instance.
- node_
count int Read capacity, i.e. number of nodes in a read pool instance.
- node
Count Number Read capacity, i.e. number of nodes in a read pool instance.
Import
Instance can be imported using any of these accepted formats
$ pulumi import gcp:alloydb/instance:Instance default {{cluster}}/instances/{{instance_id}}
$ pulumi import gcp:alloydb/instance:Instance default {{cluster}}/{{instance_id}}
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.