Backup

Example Usage

Alloydb Backup Full

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
import com.pulumi.gcp.alloydb.Cluster;
import com.pulumi.gcp.alloydb.ClusterArgs;
import com.pulumi.gcp.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) {
final var defaultNetwork = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
.name("alloydb-network")
.build());
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.clusterId("alloydb-cluster")
.location("us-central1")
.network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()
.addressType("INTERNAL")
.purpose("VPC_PEERING")
.prefixLength(16)
.network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var vpcConnection = new Connection("vpcConnection", ConnectionArgs.builder()
.network(defaultNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(privateIpAlloc.name())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.cluster(defaultCluster.name())
.instanceId("alloydb-instance")
.instanceType("PRIMARY")
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.dependsOn(vpcConnection)
.build());
var defaultBackup = new Backup("defaultBackup", BackupArgs.builder()
.location("us-central1")
.backupId("alloydb-backup")
.clusterName(defaultCluster.name())
.description("example description")
.labels(Map.of("label", "key"))
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.dependsOn(defaultInstance)
.build());
}
}

Import

Backup can be imported using any of these accepted formats

$ 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}}

Properties

Link copied to clipboard
val backupId: Output<String>

The ID of the alloydb backup.

Link copied to clipboard
val clusterName: Output<String>

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

Link copied to clipboard
val createTime: Output<String>

Time the Backup was created in UTC.

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

User-provided description of the backup.

Link copied to clipboard
val etag: Output<String>

A hash of the resource.

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

User-defined labels for the alloydb backup.

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

The location where the alloydb backup should reside.

Link copied to clipboard
val name: Output<String>

Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}

Link copied to clipboard
val project: Output<String>

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val reconciling: Output<Boolean>

If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.

Link copied to clipboard
val state: Output<String>

The current state of the backup.

Link copied to clipboard
val uid: Output<String>

Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

Link copied to clipboard
val updateTime: Output<String>

Time the Backup was updated in UTC.

Link copied to clipboard
val urn: Output<String>