Snapshot

class Snapshot : KotlinCustomResource

Provides a Network Attached Storage (NAS) Snapshot resource. For information about Network Attached Storage (NAS) Snapshot and how to use it, see What is Snapshot.

NOTE: Available in v1.152.0+. NOTE: Only Extreme NAS file systems support the snapshot feature.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.nas.NasFunctions;
import com.pulumi.alicloud.nas.inputs.GetZonesArgs;
import com.pulumi.alicloud.nas.FileSystem;
import com.pulumi.alicloud.nas.FileSystemArgs;
import com.pulumi.alicloud.nas.Snapshot;
import com.pulumi.alicloud.nas.SnapshotArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("testacc");
final var defaultZones = NasFunctions.getZones(GetZonesArgs.builder()
.fileSystemType("extreme")
.build());
var defaultFileSystem = new FileSystem("defaultFileSystem", FileSystemArgs.builder()
.fileSystemType("extreme")
.protocolType("NFS")
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].zoneId()))
.storageType("standard")
.description(name)
.capacity(100)
.build());
var defaultSnapshot = new Snapshot("defaultSnapshot", SnapshotArgs.builder()
.fileSystemId(defaultFileSystem.id())
.description(name)
.retentionDays(20)
.snapshotName(name)
.build());
}
}

Import

Network Attached Storage (NAS) Snapshot can be imported using the id, e.g.

$ pulumi import alicloud:nas/snapshot:Snapshot example <id>

Properties

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

The description of the snapshot. It must be 2 to 256 characters in length and cannot start with https:// or https://.

Link copied to clipboard
val fileSystemId: Output<String>

The ID of the file system.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val retentionDays: Output<Int>?

The retention period of the snapshot. Unit: days. Valid values:

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

SnapshotName. It must be 2 to 128 characters in length and must start with a letter, but cannot start with https:// or https://.

Link copied to clipboard
val status: Output<String>

The status of the snapshot.

Link copied to clipboard
val urn: Output<String>