Google Cloud (GCP) Classic

v6.43.0 published on Tuesday, Nov 15, 2022 by Pulumi

Cluster

Import

Cluster can be imported using any of these accepted formats

 $ pulumi import gcp:alloydb/cluster:Cluster default projects/{{project}}/locations/{{location}}/clusters/{{cluster_id}}
 $ pulumi import gcp:alloydb/cluster:Cluster default {{project}}/{{location}}/{{cluster_id}}
 $ pulumi import gcp:alloydb/cluster:Cluster default {{location}}/{{cluster_id}}
 $ pulumi import gcp:alloydb/cluster:Cluster default {{cluster_id}}

Example Usage

Alloydb Cluster Basic

using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var project = Gcp.Organizations.GetProject.Invoke();

    var defaultNetwork = new Gcp.Compute.Network("defaultNetwork", new()
    {
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

    var defaultCluster = new Gcp.Alloydb.Cluster("defaultCluster", new()
    {
        ClusterId = "alloydb-cluster",
        Location = "us-central1",
        Network = Output.Tuple(project.Apply(getProjectResult => getProjectResult), defaultNetwork.Name).Apply(values =>
        {
            var project = values.Item1;
            var name = values.Item2;
            return $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}/global/networks/{name}";
        }),
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

});
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/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, pulumi.Provider(google_beta))
		if err != nil {
			return err
		}
		_, 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),
		}, pulumi.Provider(google_beta))
		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.compute.NetworkArgs;
import com.pulumi.gcp.alloydb.Cluster;
import com.pulumi.gcp.alloydb.ClusterArgs;
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", NetworkArgs.Empty, CustomResourceOptions.builder()
            .provider(google_beta)
            .build());

        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)))
            .build(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

    }
}
import pulumi
import pulumi_gcp as gcp

project = gcp.organizations.get_project()
default_network = gcp.compute.Network("defaultNetwork", opts=pulumi.ResourceOptions(provider=google_beta))
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}"),
    opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const project = gcp.organizations.getProject({});
const defaultNetwork = new gcp.compute.Network("defaultNetwork", {}, {
    provider: google_beta,
});
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}`),
}, {
    provider: google_beta,
});
resources:
  defaultCluster:
    type: gcp:alloydb:Cluster
    properties:
      clusterId: alloydb-cluster
      location: us-central1
      network: projects/${project.number}/global/networks/${defaultNetwork.name}
    options:
      provider: ${["google-beta"]}
  defaultNetwork:
    type: gcp:compute:Network
    options:
      provider: ${["google-beta"]}
variables:
  project:
    fn::invoke:
      Function: gcp:organizations:getProject
      Arguments: {}

Alloydb Cluster Full

using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var project = Gcp.Organizations.GetProject.Invoke();

    var @default = new Gcp.Compute.Network("default", new()
    {
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

    var full = new Gcp.Alloydb.Cluster("full", new()
    {
        ClusterId = "alloydb-cluster-full",
        Location = "us-central1",
        Network = Output.Tuple(project.Apply(getProjectResult => getProjectResult), @default.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
        {
            User = "alloydb-cluster-full",
            Password = "alloydb-cluster-full",
        },
        AutomatedBackupPolicy = new Gcp.Alloydb.Inputs.ClusterAutomatedBackupPolicyArgs
        {
            Location = "us-central1",
            BackupWindow = "1800s",
            Enabled = true,
            WeeklySchedule = new Gcp.Alloydb.Inputs.ClusterAutomatedBackupPolicyWeeklyScheduleArgs
            {
                DaysOfWeeks = new[]
                {
                    "MONDAY",
                },
                StartTimes = new[]
                {
                    new Gcp.Alloydb.Inputs.ClusterAutomatedBackupPolicyWeeklyScheduleStartTimeArgs
                    {
                        Hours = 23,
                        Minutes = 0,
                        Seconds = 0,
                        Nanos = 0,
                    },
                },
            },
            QuantityBasedRetention = new Gcp.Alloydb.Inputs.ClusterAutomatedBackupPolicyQuantityBasedRetentionArgs
            {
                Count = 1,
            },
            Labels = 
            {
                { "test", "alloydb-cluster-full" },
            },
        },
        Labels = 
        {
            { "test", "alloydb-cluster-full" },
        },
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

});
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/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
		}
		_, err = compute.NewNetwork(ctx, "default", nil, pulumi.Provider(google_beta))
		if err != nil {
			return err
		}
		_, err = alloydb.NewCluster(ctx, "full", &alloydb.ClusterArgs{
			ClusterId: pulumi.String("alloydb-cluster-full"),
			Location:  pulumi.String("us-central1"),
			Network: _default.Name.ApplyT(func(name string) (string, error) {
				return fmt.Sprintf("projects/%v/global/networks/%v", project.Number, name), nil
			}).(pulumi.StringOutput),
			InitialUser: &alloydb.ClusterInitialUserArgs{
				User:     pulumi.String("alloydb-cluster-full"),
				Password: pulumi.String("alloydb-cluster-full"),
			},
			AutomatedBackupPolicy: &alloydb.ClusterAutomatedBackupPolicyArgs{
				Location:     pulumi.String("us-central1"),
				BackupWindow: pulumi.String("1800s"),
				Enabled:      pulumi.Bool(true),
				WeeklySchedule: &alloydb.ClusterAutomatedBackupPolicyWeeklyScheduleArgs{
					DaysOfWeeks: pulumi.StringArray{
						pulumi.String("MONDAY"),
					},
					StartTimes: alloydb.ClusterAutomatedBackupPolicyWeeklyScheduleStartTimeArray{
						&alloydb.ClusterAutomatedBackupPolicyWeeklyScheduleStartTimeArgs{
							Hours:   pulumi.Int(23),
							Minutes: pulumi.Int(0),
							Seconds: pulumi.Int(0),
							Nanos:   pulumi.Int(0),
						},
					},
				},
				QuantityBasedRetention: &alloydb.ClusterAutomatedBackupPolicyQuantityBasedRetentionArgs{
					Count: pulumi.Int(1),
				},
				Labels: pulumi.StringMap{
					"test": pulumi.String("alloydb-cluster-full"),
				},
			},
			Labels: pulumi.StringMap{
				"test": pulumi.String("alloydb-cluster-full"),
			},
		}, pulumi.Provider(google_beta))
		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.compute.NetworkArgs;
import com.pulumi.gcp.alloydb.Cluster;
import com.pulumi.gcp.alloydb.ClusterArgs;
import com.pulumi.gcp.alloydb.inputs.ClusterInitialUserArgs;
import com.pulumi.gcp.alloydb.inputs.ClusterAutomatedBackupPolicyArgs;
import com.pulumi.gcp.alloydb.inputs.ClusterAutomatedBackupPolicyWeeklyScheduleArgs;
import com.pulumi.gcp.alloydb.inputs.ClusterAutomatedBackupPolicyQuantityBasedRetentionArgs;
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 default_ = new Network("default", NetworkArgs.Empty, CustomResourceOptions.builder()
            .provider(google_beta)
            .build());

        var full = new Cluster("full", ClusterArgs.builder()        
            .clusterId("alloydb-cluster-full")
            .location("us-central1")
            .network(default_.name().applyValue(name -> String.format("projects/%s/global/networks/%s", project.applyValue(getProjectResult -> getProjectResult.number()),name)))
            .initialUser(ClusterInitialUserArgs.builder()
                .user("alloydb-cluster-full")
                .password("alloydb-cluster-full")
                .build())
            .automatedBackupPolicy(ClusterAutomatedBackupPolicyArgs.builder()
                .location("us-central1")
                .backupWindow("1800s")
                .enabled(true)
                .weeklySchedule(ClusterAutomatedBackupPolicyWeeklyScheduleArgs.builder()
                    .daysOfWeeks("MONDAY")
                    .startTimes(ClusterAutomatedBackupPolicyWeeklyScheduleStartTimeArgs.builder()
                        .hours(23)
                        .minutes(0)
                        .seconds(0)
                        .nanos(0)
                        .build())
                    .build())
                .quantityBasedRetention(ClusterAutomatedBackupPolicyQuantityBasedRetentionArgs.builder()
                    .count(1)
                    .build())
                .labels(Map.of("test", "alloydb-cluster-full"))
                .build())
            .labels(Map.of("test", "alloydb-cluster-full"))
            .build(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

    }
}
import pulumi
import pulumi_gcp as gcp

project = gcp.organizations.get_project()
default = gcp.compute.Network("default", opts=pulumi.ResourceOptions(provider=google_beta))
full = gcp.alloydb.Cluster("full",
    cluster_id="alloydb-cluster-full",
    location="us-central1",
    network=default.name.apply(lambda name: f"projects/{project.number}/global/networks/{name}"),
    initial_user=gcp.alloydb.ClusterInitialUserArgs(
        user="alloydb-cluster-full",
        password="alloydb-cluster-full",
    ),
    automated_backup_policy=gcp.alloydb.ClusterAutomatedBackupPolicyArgs(
        location="us-central1",
        backup_window="1800s",
        enabled=True,
        weekly_schedule=gcp.alloydb.ClusterAutomatedBackupPolicyWeeklyScheduleArgs(
            days_of_weeks=["MONDAY"],
            start_times=[gcp.alloydb.ClusterAutomatedBackupPolicyWeeklyScheduleStartTimeArgs(
                hours=23,
                minutes=0,
                seconds=0,
                nanos=0,
            )],
        ),
        quantity_based_retention=gcp.alloydb.ClusterAutomatedBackupPolicyQuantityBasedRetentionArgs(
            count=1,
        ),
        labels={
            "test": "alloydb-cluster-full",
        },
    ),
    labels={
        "test": "alloydb-cluster-full",
    },
    opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const project = gcp.organizations.getProject({});
const _default = new gcp.compute.Network("default", {}, {
    provider: google_beta,
});
const full = new gcp.alloydb.Cluster("full", {
    clusterId: "alloydb-cluster-full",
    location: "us-central1",
    network: pulumi.all([project, _default.name]).apply(([project, name]) => `projects/${project.number}/global/networks/${name}`),
    initialUser: {
        user: "alloydb-cluster-full",
        password: "alloydb-cluster-full",
    },
    automatedBackupPolicy: {
        location: "us-central1",
        backupWindow: "1800s",
        enabled: true,
        weeklySchedule: {
            daysOfWeeks: ["MONDAY"],
            startTimes: [{
                hours: 23,
                minutes: 0,
                seconds: 0,
                nanos: 0,
            }],
        },
        quantityBasedRetention: {
            count: 1,
        },
        labels: {
            test: "alloydb-cluster-full",
        },
    },
    labels: {
        test: "alloydb-cluster-full",
    },
}, {
    provider: google_beta,
});
resources:
  full:
    type: gcp:alloydb:Cluster
    properties:
      clusterId: alloydb-cluster-full
      location: us-central1
      network: projects/${project.number}/global/networks/${default.name}
      initialUser:
        user: alloydb-cluster-full
        password: alloydb-cluster-full
      automatedBackupPolicy:
        location: us-central1
        backupWindow: 1800s
        enabled: true
        weeklySchedule:
          daysOfWeeks:
            - MONDAY
          startTimes:
            - hours: 23
              minutes: 0
              seconds: 0
              nanos: 0
        quantityBasedRetention:
          count: 1
        labels:
          test: alloydb-cluster-full
      labels:
        test: alloydb-cluster-full
    options:
      provider: ${["google-beta"]}
  default:
    type: gcp:compute:Network
    options:
      provider: ${["google-beta"]}
variables:
  project:
    fn::invoke:
      Function: gcp:organizations:getProject
      Arguments: {}

Create Cluster Resource

new Cluster(name: string, args: ClusterArgs, opts?: CustomResourceOptions);
@overload
def Cluster(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            automated_backup_policy: Optional[ClusterAutomatedBackupPolicyArgs] = None,
            cluster_id: Optional[str] = None,
            display_name: Optional[str] = None,
            initial_user: Optional[ClusterInitialUserArgs] = None,
            labels: Optional[Mapping[str, str]] = None,
            location: Optional[str] = None,
            network: Optional[str] = None,
            project: Optional[str] = None)
@overload
def Cluster(resource_name: str,
            args: ClusterArgs,
            opts: Optional[ResourceOptions] = None)
func NewCluster(ctx *Context, name string, args ClusterArgs, opts ...ResourceOption) (*Cluster, error)
public Cluster(string name, ClusterArgs args, CustomResourceOptions? opts = null)
public Cluster(String name, ClusterArgs args)
public Cluster(String name, ClusterArgs args, CustomResourceOptions options)
type: gcp:alloydb:Cluster
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ClusterArgs
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 ClusterArgs
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 ClusterArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ClusterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ClusterArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Cluster 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 Cluster resource accepts the following input properties:

ClusterId string

The ID of the alloydb cluster.

Network string

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

AutomatedBackupPolicy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

DisplayName string

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

InitialUser ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

Labels Dictionary<string, string>

Labels to apply to backups created using this configuration.

Location string

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

Project string

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

ClusterId string

The ID of the alloydb cluster.

Network string

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

AutomatedBackupPolicy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

DisplayName string

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

InitialUser ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

Labels map[string]string

Labels to apply to backups created using this configuration.

Location string

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

Project string

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

clusterId String

The ID of the alloydb cluster.

network String

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

automatedBackupPolicy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

displayName String

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

initialUser ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

labels Map<String,String>

Labels to apply to backups created using this configuration.

location String

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

project String

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

clusterId string

The ID of the alloydb cluster.

network string

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

automatedBackupPolicy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

displayName string

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

initialUser ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

labels {[key: string]: string}

Labels to apply to backups created using this configuration.

location string

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

project string

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

cluster_id str

The ID of the alloydb cluster.

network str

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

automated_backup_policy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

display_name str

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

initial_user ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

labels Mapping[str, str]

Labels to apply to backups created using this configuration.

location str

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

project str

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

clusterId String

The ID of the alloydb cluster.

network String

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

automatedBackupPolicy Property Map

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

displayName String

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

initialUser Property Map

Initial user to setup during cluster creation. Structure is documented below.

labels Map<String>

Labels to apply to backups created using this configuration.

location String

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

project String

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

Outputs

All input properties are implicitly available as output properties. Additionally, the Cluster resource produces the following output properties:

BackupSources List<ClusterBackupSource>

Cluster created from backup.

DatabaseVersion string

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

Id string

The provider-assigned unique ID for this managed resource.

MigrationSources List<ClusterMigrationSource>

Cluster created via DMS migration.

Name string

The name of the cluster resource.

Uid string

The system-generated UID of the resource.

BackupSources []ClusterBackupSource

Cluster created from backup.

DatabaseVersion string

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

Id string

The provider-assigned unique ID for this managed resource.

MigrationSources []ClusterMigrationSource

Cluster created via DMS migration.

Name string

The name of the cluster resource.

Uid string

The system-generated UID of the resource.

backupSources List<ClusterBackupSource>

Cluster created from backup.

databaseVersion String

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

id String

The provider-assigned unique ID for this managed resource.

migrationSources List<ClusterMigrationSource>

Cluster created via DMS migration.

name String

The name of the cluster resource.

uid String

The system-generated UID of the resource.

backupSources ClusterBackupSource[]

Cluster created from backup.

databaseVersion string

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

id string

The provider-assigned unique ID for this managed resource.

migrationSources ClusterMigrationSource[]

Cluster created via DMS migration.

name string

The name of the cluster resource.

uid string

The system-generated UID of the resource.

backup_sources Sequence[ClusterBackupSource]

Cluster created from backup.

database_version str

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

id str

The provider-assigned unique ID for this managed resource.

migration_sources Sequence[ClusterMigrationSource]

Cluster created via DMS migration.

name str

The name of the cluster resource.

uid str

The system-generated UID of the resource.

backupSources List<Property Map>

Cluster created from backup.

databaseVersion String

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

id String

The provider-assigned unique ID for this managed resource.

migrationSources List<Property Map>

Cluster created via DMS migration.

name String

The name of the cluster resource.

uid String

The system-generated UID of the resource.

Look up Existing Cluster Resource

Get an existing Cluster 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?: ClusterState, opts?: CustomResourceOptions): Cluster
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        automated_backup_policy: Optional[ClusterAutomatedBackupPolicyArgs] = None,
        backup_sources: Optional[Sequence[ClusterBackupSourceArgs]] = None,
        cluster_id: Optional[str] = None,
        database_version: Optional[str] = None,
        display_name: Optional[str] = None,
        initial_user: Optional[ClusterInitialUserArgs] = None,
        labels: Optional[Mapping[str, str]] = None,
        location: Optional[str] = None,
        migration_sources: Optional[Sequence[ClusterMigrationSourceArgs]] = None,
        name: Optional[str] = None,
        network: Optional[str] = None,
        project: Optional[str] = None,
        uid: Optional[str] = None) -> Cluster
func GetCluster(ctx *Context, name string, id IDInput, state *ClusterState, opts ...ResourceOption) (*Cluster, error)
public static Cluster Get(string name, Input<string> id, ClusterState? state, CustomResourceOptions? opts = null)
public static Cluster get(String name, Output<String> id, ClusterState 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.
The following state arguments are supported:
AutomatedBackupPolicy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

BackupSources List<ClusterBackupSourceArgs>

Cluster created from backup.

ClusterId string

The ID of the alloydb cluster.

DatabaseVersion string

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

DisplayName string

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

InitialUser ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

Labels Dictionary<string, string>

Labels to apply to backups created using this configuration.

Location string

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

MigrationSources List<ClusterMigrationSourceArgs>

Cluster created via DMS migration.

Name string

The name of the cluster resource.

Network string

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

Project string

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

Uid string

The system-generated UID of the resource.

AutomatedBackupPolicy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

BackupSources []ClusterBackupSourceArgs

Cluster created from backup.

ClusterId string

The ID of the alloydb cluster.

DatabaseVersion string

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

DisplayName string

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

InitialUser ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

Labels map[string]string

Labels to apply to backups created using this configuration.

Location string

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

MigrationSources []ClusterMigrationSourceArgs

Cluster created via DMS migration.

Name string

The name of the cluster resource.

Network string

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

Project string

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

Uid string

The system-generated UID of the resource.

automatedBackupPolicy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

backupSources List<ClusterBackupSourceArgs>

Cluster created from backup.

clusterId String

The ID of the alloydb cluster.

databaseVersion String

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

displayName String

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

initialUser ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

labels Map<String,String>

Labels to apply to backups created using this configuration.

location String

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

migrationSources List<ClusterMigrationSourceArgs>

Cluster created via DMS migration.

name String

The name of the cluster resource.

network String

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

project String

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

uid String

The system-generated UID of the resource.

automatedBackupPolicy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

backupSources ClusterBackupSourceArgs[]

Cluster created from backup.

clusterId string

The ID of the alloydb cluster.

databaseVersion string

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

displayName string

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

initialUser ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

labels {[key: string]: string}

Labels to apply to backups created using this configuration.

location string

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

migrationSources ClusterMigrationSourceArgs[]

Cluster created via DMS migration.

name string

The name of the cluster resource.

network string

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

project string

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

uid string

The system-generated UID of the resource.

automated_backup_policy ClusterAutomatedBackupPolicyArgs

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

backup_sources Sequence[ClusterBackupSourceArgs]

Cluster created from backup.

cluster_id str

The ID of the alloydb cluster.

database_version str

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

display_name str

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

initial_user ClusterInitialUserArgs

Initial user to setup during cluster creation. Structure is documented below.

labels Mapping[str, str]

Labels to apply to backups created using this configuration.

location str

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

migration_sources Sequence[ClusterMigrationSourceArgs]

Cluster created via DMS migration.

name str

The name of the cluster resource.

network str

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

project str

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

uid str

The system-generated UID of the resource.

automatedBackupPolicy Property Map

The automated backup policy for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. Structure is documented below.

backupSources List<Property Map>

Cluster created from backup.

clusterId String

The ID of the alloydb cluster.

databaseVersion String

The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.

displayName String

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

initialUser Property Map

Initial user to setup during cluster creation. Structure is documented below.

labels Map<String>

Labels to apply to backups created using this configuration.

location String

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

migrationSources List<Property Map>

Cluster created via DMS migration.

name String

The name of the cluster resource.

network String

The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".

project String

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

uid String

The system-generated UID of the resource.

Supporting Types

ClusterAutomatedBackupPolicy

WeeklySchedule ClusterAutomatedBackupPolicyWeeklySchedule

Weekly schedule for the Backup. Structure is documented below.

BackupWindow string

The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it will default to 1 hour. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

Enabled bool

Whether automated automated backups are enabled.

Labels Dictionary<string, string>

Labels to apply to backups created using this configuration.

Location string

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

QuantityBasedRetention ClusterAutomatedBackupPolicyQuantityBasedRetention

Quantity-based Backup retention policy to retain recent backups. Structure is documented below.

TimeBasedRetention ClusterAutomatedBackupPolicyTimeBasedRetention

Time-based Backup retention policy. Structure is documented below.

WeeklySchedule ClusterAutomatedBackupPolicyWeeklySchedule

Weekly schedule for the Backup. Structure is documented below.

BackupWindow string

The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it will default to 1 hour. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

Enabled bool

Whether automated automated backups are enabled.

Labels map[string]string

Labels to apply to backups created using this configuration.

Location string

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

QuantityBasedRetention ClusterAutomatedBackupPolicyQuantityBasedRetention

Quantity-based Backup retention policy to retain recent backups. Structure is documented below.

TimeBasedRetention ClusterAutomatedBackupPolicyTimeBasedRetention

Time-based Backup retention policy. Structure is documented below.

weeklySchedule ClusterAutomatedBackupPolicyWeeklySchedule

Weekly schedule for the Backup. Structure is documented below.

backupWindow String

The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it will default to 1 hour. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

enabled Boolean

Whether automated automated backups are enabled.

labels Map<String,String>

Labels to apply to backups created using this configuration.

location String

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

quantityBasedRetention ClusterAutomatedBackupPolicyQuantityBasedRetention

Quantity-based Backup retention policy to retain recent backups. Structure is documented below.

timeBasedRetention ClusterAutomatedBackupPolicyTimeBasedRetention

Time-based Backup retention policy. Structure is documented below.

weeklySchedule ClusterAutomatedBackupPolicyWeeklySchedule

Weekly schedule for the Backup. Structure is documented below.

backupWindow string

The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it will default to 1 hour. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

enabled boolean

Whether automated automated backups are enabled.

labels {[key: string]: string}

Labels to apply to backups created using this configuration.

location string

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

quantityBasedRetention ClusterAutomatedBackupPolicyQuantityBasedRetention

Quantity-based Backup retention policy to retain recent backups. Structure is documented below.

timeBasedRetention ClusterAutomatedBackupPolicyTimeBasedRetention

Time-based Backup retention policy. Structure is documented below.

weekly_schedule ClusterAutomatedBackupPolicyWeeklySchedule

Weekly schedule for the Backup. Structure is documented below.

backup_window str

The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it will default to 1 hour. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

enabled bool

Whether automated automated backups are enabled.

labels Mapping[str, str]

Labels to apply to backups created using this configuration.

location str

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

quantity_based_retention ClusterAutomatedBackupPolicyQuantityBasedRetention

Quantity-based Backup retention policy to retain recent backups. Structure is documented below.

time_based_retention ClusterAutomatedBackupPolicyTimeBasedRetention

Time-based Backup retention policy. Structure is documented below.

weeklySchedule Property Map

Weekly schedule for the Backup. Structure is documented below.

backupWindow String

The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it will default to 1 hour. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

enabled Boolean

Whether automated automated backups are enabled.

labels Map<String>

Labels to apply to backups created using this configuration.

location String

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.

quantityBasedRetention Property Map

Quantity-based Backup retention policy to retain recent backups. Structure is documented below.

timeBasedRetention Property Map

Time-based Backup retention policy. Structure is documented below.

ClusterAutomatedBackupPolicyQuantityBasedRetention

Count int

The number of backups to retain.

Count int

The number of backups to retain.

count Integer

The number of backups to retain.

count number

The number of backups to retain.

count int

The number of backups to retain.

count Number

The number of backups to retain.

ClusterAutomatedBackupPolicyTimeBasedRetention

RetentionPeriod string

The retention period. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

RetentionPeriod string

The retention period. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

retentionPeriod String

The retention period. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

retentionPeriod string

The retention period. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

retention_period str

The retention period. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

retentionPeriod String

The retention period. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

ClusterAutomatedBackupPolicyWeeklySchedule

StartTimes List<ClusterAutomatedBackupPolicyWeeklyScheduleStartTime>

The times during the day to start a backup. At least one start time must be provided. The start times are assumed to be in UTC and to be an exact hour (e.g., 04:00:00). Structure is documented below.

DaysOfWeeks List<string>

The days of the week to perform a backup. At least one day of the week must be provided. Each value may be one of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, and SUNDAY.

StartTimes []ClusterAutomatedBackupPolicyWeeklyScheduleStartTime

The times during the day to start a backup. At least one start time must be provided. The start times are assumed to be in UTC and to be an exact hour (e.g., 04:00:00). Structure is documented below.

DaysOfWeeks []string

The days of the week to perform a backup. At least one day of the week must be provided. Each value may be one of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, and SUNDAY.

startTimes List<ClusterAutomatedBackupPolicyWeeklyScheduleStartTime>

The times during the day to start a backup. At least one start time must be provided. The start times are assumed to be in UTC and to be an exact hour (e.g., 04:00:00). Structure is documented below.

daysOfWeeks List<String>

The days of the week to perform a backup. At least one day of the week must be provided. Each value may be one of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, and SUNDAY.

startTimes ClusterAutomatedBackupPolicyWeeklyScheduleStartTime[]

The times during the day to start a backup. At least one start time must be provided. The start times are assumed to be in UTC and to be an exact hour (e.g., 04:00:00). Structure is documented below.

daysOfWeeks string[]

The days of the week to perform a backup. At least one day of the week must be provided. Each value may be one of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, and SUNDAY.

start_times Sequence[ClusterAutomatedBackupPolicyWeeklyScheduleStartTime]

The times during the day to start a backup. At least one start time must be provided. The start times are assumed to be in UTC and to be an exact hour (e.g., 04:00:00). Structure is documented below.

days_of_weeks Sequence[str]

The days of the week to perform a backup. At least one day of the week must be provided. Each value may be one of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, and SUNDAY.

startTimes List<Property Map>

The times during the day to start a backup. At least one start time must be provided. The start times are assumed to be in UTC and to be an exact hour (e.g., 04:00:00). Structure is documented below.

daysOfWeeks List<String>

The days of the week to perform a backup. At least one day of the week must be provided. Each value may be one of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, and SUNDAY.

ClusterAutomatedBackupPolicyWeeklyScheduleStartTime

Hours int

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

Minutes int

Minutes of hour of day. Must be from 0 to 59.

Nanos int

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

Seconds int

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

Hours int

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

Minutes int

Minutes of hour of day. Must be from 0 to 59.

Nanos int

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

Seconds int

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

hours Integer

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

minutes Integer

Minutes of hour of day. Must be from 0 to 59.

nanos Integer

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

seconds Integer

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

hours number

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

minutes number

Minutes of hour of day. Must be from 0 to 59.

nanos number

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

seconds number

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

hours int

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

minutes int

Minutes of hour of day. Must be from 0 to 59.

nanos int

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

seconds int

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

hours Number

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

minutes Number

Minutes of hour of day. Must be from 0 to 59.

nanos Number

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

seconds Number

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

ClusterBackupSource

BackupName string
BackupName string
backupName String
backupName string
backupName String

ClusterInitialUser

Password string

The initial password for the user. Note: This property is sensitive and will not be displayed in the plan.

User string

The database username.

Password string

The initial password for the user. Note: This property is sensitive and will not be displayed in the plan.

User string

The database username.

password String

The initial password for the user. Note: This property is sensitive and will not be displayed in the plan.

user String

The database username.

password string

The initial password for the user. Note: This property is sensitive and will not be displayed in the plan.

user string

The database username.

password str

The initial password for the user. Note: This property is sensitive and will not be displayed in the plan.

user str

The database username.

password String

The initial password for the user. Note: This property is sensitive and will not be displayed in the plan.

user String

The database username.

ClusterMigrationSource

HostPort string
ReferenceId string
SourceType string
HostPort string
ReferenceId string
SourceType string
hostPort String
referenceId String
sourceType String
hostPort string
referenceId string
sourceType string
hostPort String
referenceId String
sourceType String

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.