Backup class

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: "network",
});
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="network")
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 = "network",
    });

    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/v9/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v9/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: pulumi.StringRef("network"),
		}, 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().ToIDOutput().ToStringOutput(),
			},
		})
		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().ToIDOutput().ToStringOutput(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

data "gcp_compute_getnetwork" "default" {
  name = "network"
}

resource "gcp_netapp_storagepool" "default" {
  name          = "backup-pool"
  location      = "us-central1"
  service_level = "PREMIUM"
  capacity_gib  = "2048"
  network       = data.gcp_compute_getnetwork.default.id
}
resource "gcp_netapp_volume" "default" {
  name            = "backup-volume"
  location        = gcp_netapp_storagepool.default.location
  capacity_gib    = "100"
  share_name      = "backup-volume"
  storage_pool    = gcp_netapp_storagepool.default.name
  protocols       = ["NFSV3"]
  deletion_policy = "FORCE"
  backup_config = {
    backup_vault = gcp_netapp_backupvault.default.id
  }
}
resource "gcp_netapp_backupvault" "default" {
  name     = "backup-vault"
  location = gcp_netapp_storagepool.default.location
}
resource "gcp_netapp_backup" "test_backup" {
  name          = "test-backup"
  location      = gcp_netapp_backupvault.default.location
  vault_name    = gcp_netapp_backupvault.default.name
  source_volume = gcp_netapp_volume.default.id
}
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.ArrayList;
import java.util.Arrays;
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("network")
            .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: network

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

Constructors

Backup(String name, {BackupArgs? args, CustomResourceOptions? options})
Creates a new Backup. name The Pulumi resource name. args Arguments used to configure this Backup. The set of arguments for Backup. options Resource options controlling this resource's behavior.
Backup.reference(String urn)
Creates a typed reference to an existing Backup resource.

Properties

backupRegion ↔ Output<String>
Region in which backup is stored.
latefinal
backupType ↔ Output<String>
Type of backup, manually created or created by a backup policy. Possible Values : TYPE_UNSPECIFIED, MANUAL, SCHEDULED
latefinal
chainStorageBytes ↔ Output<String>
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)
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
createTime ↔ Output<String>
Create time of the backup. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z".
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
description ↔ Output<String?>
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
latefinal
effectiveLabels ↔ Output<Map<String, String>>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
labels ↔ Output<Map<String, String>?>
Labels as key value pairs. Example: { "owner": "Bob", "department": "finance", "purpose": "testing" }.
latefinal
location ↔ Output<String>
Location of the backup.
latefinal
name ↔ Output<String>
The resource name of the backup. Needs to be unique per location.
latefinal
ontapSource ↔ Output<BackupOntapSource?>
Details of the ONTAP source volume and snapshot. Structure is documented below.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
pulumiLabels ↔ Output<Map<String, String>>
The combination of labels configured directly on the resource and default labels configured on the provider.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
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}}``
latefinal
sourceVolume ↔ Output<String?>
ID of volumes this backup belongs to. Format: `projects/{{projects_id}}/locations/{{location}}/volumes/{{name}}``
latefinal
state ↔ Output<String>
The state of the Backup Vault. Possible Values : STATE_UNSPECIFIED, CREATING, UPLOADING, READY, DELETING, ERROR, UPDATING
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
vaultName ↔ Output<String>
Name of the backup vault to store the backup in.
latefinal
volumeRegion ↔ Output<String>
Region of the volume from which the backup was created.
latefinal
volumeUsageBytes ↔ Output<String>
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.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {BackupState? state, CustomResourceOptions? options}) → Backup
Gets an existing Backup resource's state with the given name and id.