BackupArgs

data class BackupArgs(val annotations: Output<Map<String, String>>? = null, val backupId: Output<String>? = null, val clusterName: Output<String>? = null, val description: Output<String>? = null, val displayName: Output<String>? = null, val encryptionConfig: Output<BackupEncryptionConfigArgs>? = null, val labels: Output<Map<String, String>>? = null, val location: Output<String>? = null, val project: Output<String>? = null, val type: Output<String>? = null) : ConvertibleToJava<BackupArgs>

An AlloyDB Backup. To get more information about Backup, see:

Example Usage

Alloydb Backup Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.alloydb.Cluster;
import com.pulumi.gcp.alloydb.ClusterArgs;
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.Backup;
import com.pulumi.gcp.alloydb.BackupArgs;
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) {
var defaultNetwork = new Network("defaultNetwork");
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.clusterId("alloydb-cluster")
.location("us-central1")
.network(defaultNetwork.id())
.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")
.build(), CustomResourceOptions.builder()
.dependsOn(vpcConnection)
.build());
var defaultBackup = new Backup("defaultBackup", BackupArgs.builder()
.location("us-central1")
.backupId("alloydb-backup")
.clusterName(defaultCluster.name())
.build(), CustomResourceOptions.builder()
.dependsOn(defaultInstance)
.build());
}
}

Alloydb Backup Full

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.alloydb.Cluster;
import com.pulumi.gcp.alloydb.ClusterArgs;
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.Backup;
import com.pulumi.gcp.alloydb.BackupArgs;
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) {
var defaultNetwork = new Network("defaultNetwork");
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.clusterId("alloydb-cluster")
.location("us-central1")
.network(defaultNetwork.id())
.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")
.build(), CustomResourceOptions.builder()
.dependsOn(vpcConnection)
.build());
var defaultBackup = new Backup("defaultBackup", BackupArgs.builder()
.location("us-central1")
.backupId("alloydb-backup")
.clusterName(defaultCluster.name())
.description("example description")
.type("ON_DEMAND")
.labels(Map.of("label", "key"))
.build(), CustomResourceOptions.builder()
.dependsOn(defaultInstance)
.build());
}
}

Import

Backup can be imported using any of these accepted formats* projects/{{project}}/locations/{{location}}/backups/{{backup_id}} * {{project}}/{{location}}/{{backup_id}} * {{location}}/{{backup_id}} In Terraform v1.5.0 and later, use an import block to import Backup using one of the formats above. For exampletf import { id = "projects/{{project}}/locations/{{location}}/backups/{{backup_id}}" to = google_alloydb_backup.default }

$ pulumi import gcp:alloydb/backup:Backup When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Backup can be imported using one of the formats above. For example
$ pulumi import gcp:alloydb/backup:Backup default projects/{{project}}/locations/{{location}}/backups/{{backup_id}}
$ pulumi import gcp:alloydb/backup:Backup default {{project}}/{{location}}/{{backup_id}}
$ pulumi import gcp:alloydb/backup:Backup default {{location}}/{{backup_id}}

Constructors

Link copied to clipboard
fun BackupArgs(annotations: Output<Map<String, String>>? = null, backupId: Output<String>? = null, clusterName: Output<String>? = null, description: Output<String>? = null, displayName: Output<String>? = null, encryptionConfig: Output<BackupEncryptionConfigArgs>? = null, labels: Output<Map<String, String>>? = null, location: Output<String>? = null, project: Output<String>? = null, type: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): BackupArgs

Properties

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

Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128 An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.

Link copied to clipboard
val backupId: Output<String>? = null

The ID of the alloydb backup.

Link copied to clipboard
val clusterName: Output<String>? = null

The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).

Link copied to clipboard
val description: Output<String>? = null

User-provided description of the backup.

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

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

Link copied to clipboard

EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is documented below.

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

User-defined labels for the alloydb backup. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Link copied to clipboard
val location: Output<String>? = null

The location where the alloydb backup should reside.

Link copied to clipboard
val project: Output<String>? = null

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

Link copied to clipboard
val type: Output<String>? = null

The backup type, which suggests the trigger for the backup. Possible values are: TYPE_UNSPECIFIED, ON_DEMAND, AUTOMATED, CONTINUOUS.