Backup

class Backup : KotlinCustomResource

NetApp Volumes supports volume backups, which are copies of your volumes stored independently from the volume. Backups are stored in backup vaults, which are containers for backups. If a volume is lost or deleted, you can use backups to restore your data to a new volume. When you create the first backup of a volume, all of the volume's used data is sent to the backup vault. Subsequent backups of the same volume only include data that has changed from the previous backup. This allows for fast incremental-forever backups and reduces the required capacity inside the backup vault. You can create manual and scheduled backups. Manual backups can be taken from a volume or from an existing volume snapshot. Scheduled backups require a backup policy. To get more information about backup, see:

Example Usage

Netapp Backup

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const default = gcp.compute.getNetwork({
name: "",
});
const defaultStoragePool = new gcp.netapp.StoragePool("default", {
name: "backup-pool",
location: "us-central1",
serviceLevel: "PREMIUM",
capacityGib: "2048",
network: _default.then(_default => _default.id),
});
const defaultBackupVault = new gcp.netapp.BackupVault("default", {
name: "backup-vault",
location: defaultStoragePool.location,
});
const defaultVolume = new gcp.netapp.Volume("default", {
name: "backup-volume",
location: defaultStoragePool.location,
capacityGib: "100",
shareName: "backup-volume",
storagePool: defaultStoragePool.name,
protocols: ["NFSV3"],
deletionPolicy: "FORCE",
backupConfig: {
backupVault: defaultBackupVault.id,
},
});
const testBackup = new gcp.netapp.Backup("test_backup", {
name: "test-backup",
location: defaultBackupVault.location,
vaultName: defaultBackupVault.name,
sourceVolume: defaultVolume.id,
});
import pulumi
import pulumi_gcp as gcp
default = gcp.compute.get_network(name="")
default_storage_pool = gcp.netapp.StoragePool("default",
name="backup-pool",
location="us-central1",
service_level="PREMIUM",
capacity_gib="2048",
network=default.id)
default_backup_vault = gcp.netapp.BackupVault("default",
name="backup-vault",
location=default_storage_pool.location)
default_volume = gcp.netapp.Volume("default",
name="backup-volume",
location=default_storage_pool.location,
capacity_gib="100",
share_name="backup-volume",
storage_pool=default_storage_pool.name,
protocols=["NFSV3"],
deletion_policy="FORCE",
backup_config={
"backup_vault": default_backup_vault.id,
})
test_backup = gcp.netapp.Backup("test_backup",
name="test-backup",
location=default_backup_vault.location,
vault_name=default_backup_vault.name,
source_volume=default_volume.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = Gcp.Compute.GetNetwork.Invoke(new()
{
Name = "",
});
var defaultStoragePool = new Gcp.Netapp.StoragePool("default", new()
{
Name = "backup-pool",
Location = "us-central1",
ServiceLevel = "PREMIUM",
CapacityGib = "2048",
Network = @default.Apply(@default => @default.Apply(getNetworkResult => getNetworkResult.Id)),
});
var defaultBackupVault = new Gcp.Netapp.BackupVault("default", new()
{
Name = "backup-vault",
Location = defaultStoragePool.Location,
});
var defaultVolume = new Gcp.Netapp.Volume("default", new()
{
Name = "backup-volume",
Location = defaultStoragePool.Location,
CapacityGib = "100",
ShareName = "backup-volume",
StoragePool = defaultStoragePool.Name,
Protocols = new[]
{
"NFSV3",
},
DeletionPolicy = "FORCE",
BackupConfig = new Gcp.Netapp.Inputs.VolumeBackupConfigArgs
{
BackupVault = defaultBackupVault.Id,
},
});
var testBackup = new Gcp.Netapp.Backup("test_backup", new()
{
Name = "test-backup",
Location = defaultBackupVault.Location,
VaultName = defaultBackupVault.Name,
SourceVolume = defaultVolume.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/netapp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
Name: "",
}, nil)
if err != nil {
return err
}
defaultStoragePool, err := netapp.NewStoragePool(ctx, "default", &netapp.StoragePoolArgs{
Name: pulumi.String("backup-pool"),
Location: pulumi.String("us-central1"),
ServiceLevel: pulumi.String("PREMIUM"),
CapacityGib: pulumi.String("2048"),
Network: pulumi.String(_default.Id),
})
if err != nil {
return err
}
defaultBackupVault, err := netapp.NewBackupVault(ctx, "default", &netapp.BackupVaultArgs{
Name: pulumi.String("backup-vault"),
Location: defaultStoragePool.Location,
})
if err != nil {
return err
}
defaultVolume, err := netapp.NewVolume(ctx, "default", &netapp.VolumeArgs{
Name: pulumi.String("backup-volume"),
Location: defaultStoragePool.Location,
CapacityGib: pulumi.String("100"),
ShareName: pulumi.String("backup-volume"),
StoragePool: defaultStoragePool.Name,
Protocols: pulumi.StringArray{
pulumi.String("NFSV3"),
},
DeletionPolicy: pulumi.String("FORCE"),
BackupConfig: &netapp.VolumeBackupConfigArgs{
BackupVault: defaultBackupVault.ID(),
},
})
if err != nil {
return err
}
_, err = netapp.NewBackup(ctx, "test_backup", &netapp.BackupArgs{
Name: pulumi.String("test-backup"),
Location: defaultBackupVault.Location,
VaultName: defaultBackupVault.Name,
SourceVolume: defaultVolume.ID(),
})
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.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
import com.pulumi.gcp.netapp.StoragePool;
import com.pulumi.gcp.netapp.StoragePoolArgs;
import com.pulumi.gcp.netapp.BackupVault;
import com.pulumi.gcp.netapp.BackupVaultArgs;
import com.pulumi.gcp.netapp.Volume;
import com.pulumi.gcp.netapp.VolumeArgs;
import com.pulumi.gcp.netapp.inputs.VolumeBackupConfigArgs;
import com.pulumi.gcp.netapp.Backup;
import com.pulumi.gcp.netapp.BackupArgs;
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 default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
.name("")
.build());
var defaultStoragePool = new StoragePool("defaultStoragePool", StoragePoolArgs.builder()
.name("backup-pool")
.location("us-central1")
.serviceLevel("PREMIUM")
.capacityGib("2048")
.network(default_.id())
.build());
var defaultBackupVault = new BackupVault("defaultBackupVault", BackupVaultArgs.builder()
.name("backup-vault")
.location(defaultStoragePool.location())
.build());
var defaultVolume = new Volume("defaultVolume", VolumeArgs.builder()
.name("backup-volume")
.location(defaultStoragePool.location())
.capacityGib("100")
.shareName("backup-volume")
.storagePool(defaultStoragePool.name())
.protocols("NFSV3")
.deletionPolicy("FORCE")
.backupConfig(VolumeBackupConfigArgs.builder()
.backupVault(defaultBackupVault.id())
.build())
.build());
var testBackup = new Backup("testBackup", BackupArgs.builder()
.name("test-backup")
.location(defaultBackupVault.location())
.vaultName(defaultBackupVault.name())
.sourceVolume(defaultVolume.id())
.build());
}
}
resources:
defaultStoragePool:
type: gcp:netapp:StoragePool
name: default
properties:
name: backup-pool
location: us-central1
serviceLevel: PREMIUM
capacityGib: '2048'
network: ${default.id}
defaultVolume:
type: gcp:netapp:Volume
name: default
properties:
name: backup-volume
location: ${defaultStoragePool.location}
capacityGib: '100'
shareName: backup-volume
storagePool: ${defaultStoragePool.name}
protocols:
- NFSV3
deletionPolicy: FORCE
backupConfig:
backupVault: ${defaultBackupVault.id}
defaultBackupVault:
type: gcp:netapp:BackupVault
name: default
properties:
name: backup-vault
location: ${defaultStoragePool.location}
testBackup:
type: gcp:netapp:Backup
name: test_backup
properties:
name: test-backup
location: ${defaultBackupVault.location}
vaultName: ${defaultBackupVault.name}
sourceVolume: ${defaultVolume.id}
variables:
default:
fn::invoke:
Function: gcp:compute:getNetwork
Arguments:
name:

Import

backup can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/backupVaults/{{vault_name}}/backups/{{name}}

  • {{project}}/{{location}}/{{vault_name}}/{{name}}

  • {{location}}/{{vault_name}}/{{name}} When using the pulumi import command, backup can be imported using one of the formats above. For example:

$ pulumi import gcp:netapp/backup:Backup default projects/{{project}}/locations/{{location}}/backupVaults/{{vault_name}}/backups/{{name}}
$ pulumi import gcp:netapp/backup:Backup default {{project}}/{{location}}/{{vault_name}}/{{name}}
$ pulumi import gcp:netapp/backup:Backup default {{location}}/{{vault_name}}/{{name}}

Properties

Link copied to clipboard
val backupType: Output<String>

Type of backup, manually created or created by a backup policy. Possible Values : TYPE_UNSPECIFIED, MANUAL, SCHEDULED

Link copied to clipboard

Backups of a volume build incrementally on top of each other. They form a "backup chain". Total size of all backups in a chain in bytes = baseline backup size + sum(incremental backup size)

Link copied to clipboard
val createTime: Output<String>

Create time of the backup. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z".

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

A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.

Link copied to clipboard

All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.

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

Labels as key value pairs. Example: { "owner": "Bob", "department": "finance", "purpose": "testing" }. 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>

Location of the backup.

Link copied to clipboard
val name: Output<String>

The resource name of the backup. Needs to be unique per location.

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
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
val pulumiLabels: Output<Map<String, String>>

The combination of labels configured directly on the resource and default labels configured on the provider.

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

If specified, backup will be created from the given snapshot. If not specified, there will be a new snapshot taken to initiate the backup creation. Format: `projects/{{projectId}}/locations/{{location}}/volumes/{{volumename}}/snapshots/{{snapshotname}}``

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

ID of volumes this backup belongs to. Format: `projects/{{projects_id}}/locations/{{location}}/volumes/{{name}}``

Link copied to clipboard
val state: Output<String>

The state of the Backup Vault. Possible Values : STATE_UNSPECIFIED, CREATING, UPLOADING, READY, DELETING, ERROR, UPDATING

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vaultName: Output<String>

Name of the backup vault to store the backup in.

Link copied to clipboard

Size of the file system when the backup was created. When creating a new volume from the backup, the volume capacity will have to be at least as big.