The aws:fsx/backup:Backup resource, part of the Pulumi AWS provider, creates manual backups of FSx file systems (Lustre, Windows, OpenZFS) or ONTAP volumes. This guide focuses on two capabilities: file system backups across FSx types and volume-level backups for ONTAP.
Backups reference existing FSx file systems or ONTAP volumes. The file systems themselves require VPC subnets and may require Active Directory integration. The examples are intentionally small. Combine them with your own FSx infrastructure and backup scheduling logic.
Back up a Lustre file system
High-performance computing workloads running on FSx for Lustre often need point-in-time backups for disaster recovery or data migration.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleLustreFileSystem = new aws.fsx.LustreFileSystem("example", {
storageCapacity: 1200,
subnetIds: exampleAwsSubnet.id,
deploymentType: "PERSISTENT_1",
perUnitStorageThroughput: 50,
});
const example = new aws.fsx.Backup("example", {fileSystemId: exampleLustreFileSystem.id});
import pulumi
import pulumi_aws as aws
example_lustre_file_system = aws.fsx.LustreFileSystem("example",
storage_capacity=1200,
subnet_ids=example_aws_subnet["id"],
deployment_type="PERSISTENT_1",
per_unit_storage_throughput=50)
example = aws.fsx.Backup("example", file_system_id=example_lustre_file_system.id)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/fsx"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleLustreFileSystem, err := fsx.NewLustreFileSystem(ctx, "example", &fsx.LustreFileSystemArgs{
StorageCapacity: pulumi.Int(1200),
SubnetIds: pulumi.Any(exampleAwsSubnet.Id),
DeploymentType: pulumi.String("PERSISTENT_1"),
PerUnitStorageThroughput: pulumi.Int(50),
})
if err != nil {
return err
}
_, err = fsx.NewBackup(ctx, "example", &fsx.BackupArgs{
FileSystemId: exampleLustreFileSystem.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleLustreFileSystem = new Aws.Fsx.LustreFileSystem("example", new()
{
StorageCapacity = 1200,
SubnetIds = exampleAwsSubnet.Id,
DeploymentType = "PERSISTENT_1",
PerUnitStorageThroughput = 50,
});
var example = new Aws.Fsx.Backup("example", new()
{
FileSystemId = exampleLustreFileSystem.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.fsx.LustreFileSystem;
import com.pulumi.aws.fsx.LustreFileSystemArgs;
import com.pulumi.aws.fsx.Backup;
import com.pulumi.aws.fsx.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) {
var exampleLustreFileSystem = new LustreFileSystem("exampleLustreFileSystem", LustreFileSystemArgs.builder()
.storageCapacity(1200)
.subnetIds(exampleAwsSubnet.id())
.deploymentType("PERSISTENT_1")
.perUnitStorageThroughput(50)
.build());
var example = new Backup("example", BackupArgs.builder()
.fileSystemId(exampleLustreFileSystem.id())
.build());
}
}
resources:
example:
type: aws:fsx:Backup
properties:
fileSystemId: ${exampleLustreFileSystem.id}
exampleLustreFileSystem:
type: aws:fsx:LustreFileSystem
name: example
properties:
storageCapacity: 1200
subnetIds: ${exampleAwsSubnet.id}
deploymentType: PERSISTENT_1
perUnitStorageThroughput: 50
The fileSystemId property references the Lustre file system to back up. FSx creates a consistent snapshot of the file system at the time the backup resource is created. Lustre backups capture the entire file system state.
Back up a Windows file system
Windows file servers integrated with Active Directory require backups to protect shared drives and user data.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleWindowsFileSystem = new aws.fsx.WindowsFileSystem("example", {
activeDirectoryId: eample.id,
skipFinalBackup: true,
storageCapacity: 32,
subnetIds: [example1.id],
throughputCapacity: 8,
});
const example = new aws.fsx.Backup("example", {fileSystemId: exampleWindowsFileSystem.id});
import pulumi
import pulumi_aws as aws
example_windows_file_system = aws.fsx.WindowsFileSystem("example",
active_directory_id=eample["id"],
skip_final_backup=True,
storage_capacity=32,
subnet_ids=[example1["id"]],
throughput_capacity=8)
example = aws.fsx.Backup("example", file_system_id=example_windows_file_system.id)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/fsx"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleWindowsFileSystem, err := fsx.NewWindowsFileSystem(ctx, "example", &fsx.WindowsFileSystemArgs{
ActiveDirectoryId: pulumi.Any(eample.Id),
SkipFinalBackup: pulumi.Bool(true),
StorageCapacity: pulumi.Int(32),
SubnetIds: pulumi.StringArray{
example1.Id,
},
ThroughputCapacity: pulumi.Int(8),
})
if err != nil {
return err
}
_, err = fsx.NewBackup(ctx, "example", &fsx.BackupArgs{
FileSystemId: exampleWindowsFileSystem.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleWindowsFileSystem = new Aws.Fsx.WindowsFileSystem("example", new()
{
ActiveDirectoryId = eample.Id,
SkipFinalBackup = true,
StorageCapacity = 32,
SubnetIds = new[]
{
example1.Id,
},
ThroughputCapacity = 8,
});
var example = new Aws.Fsx.Backup("example", new()
{
FileSystemId = exampleWindowsFileSystem.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.fsx.WindowsFileSystem;
import com.pulumi.aws.fsx.WindowsFileSystemArgs;
import com.pulumi.aws.fsx.Backup;
import com.pulumi.aws.fsx.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) {
var exampleWindowsFileSystem = new WindowsFileSystem("exampleWindowsFileSystem", WindowsFileSystemArgs.builder()
.activeDirectoryId(eample.id())
.skipFinalBackup(true)
.storageCapacity(32)
.subnetIds(example1.id())
.throughputCapacity(8)
.build());
var example = new Backup("example", BackupArgs.builder()
.fileSystemId(exampleWindowsFileSystem.id())
.build());
}
}
resources:
example:
type: aws:fsx:Backup
properties:
fileSystemId: ${exampleWindowsFileSystem.id}
exampleWindowsFileSystem:
type: aws:fsx:WindowsFileSystem
name: example
properties:
activeDirectoryId: ${eample.id}
skipFinalBackup: true
storageCapacity: 32
subnetIds:
- ${example1.id}
throughputCapacity: 8
The fileSystemId property references the Windows file system. Windows backups include all shares, permissions, and Active Directory integration settings. The backup is application-consistent for Windows workloads.
Back up an ONTAP volume
NetApp ONTAP volumes store application data that needs volume-level backup granularity rather than backing up the entire file system.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleOntapVolume = new aws.fsx.OntapVolume("example", {
name: "example",
junctionPath: "/example",
sizeInMegabytes: 1024,
storageEfficiencyEnabled: true,
storageVirtualMachineId: test.id,
});
const example = new aws.fsx.Backup("example", {volumeId: exampleOntapVolume.id});
import pulumi
import pulumi_aws as aws
example_ontap_volume = aws.fsx.OntapVolume("example",
name="example",
junction_path="/example",
size_in_megabytes=1024,
storage_efficiency_enabled=True,
storage_virtual_machine_id=test["id"])
example = aws.fsx.Backup("example", volume_id=example_ontap_volume.id)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/fsx"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleOntapVolume, err := fsx.NewOntapVolume(ctx, "example", &fsx.OntapVolumeArgs{
Name: pulumi.String("example"),
JunctionPath: pulumi.String("/example"),
SizeInMegabytes: pulumi.Int(1024),
StorageEfficiencyEnabled: pulumi.Bool(true),
StorageVirtualMachineId: pulumi.Any(test.Id),
})
if err != nil {
return err
}
_, err = fsx.NewBackup(ctx, "example", &fsx.BackupArgs{
VolumeId: exampleOntapVolume.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleOntapVolume = new Aws.Fsx.OntapVolume("example", new()
{
Name = "example",
JunctionPath = "/example",
SizeInMegabytes = 1024,
StorageEfficiencyEnabled = true,
StorageVirtualMachineId = test.Id,
});
var example = new Aws.Fsx.Backup("example", new()
{
VolumeId = exampleOntapVolume.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.fsx.OntapVolume;
import com.pulumi.aws.fsx.OntapVolumeArgs;
import com.pulumi.aws.fsx.Backup;
import com.pulumi.aws.fsx.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) {
var exampleOntapVolume = new OntapVolume("exampleOntapVolume", OntapVolumeArgs.builder()
.name("example")
.junctionPath("/example")
.sizeInMegabytes(1024)
.storageEfficiencyEnabled(true)
.storageVirtualMachineId(test.id())
.build());
var example = new Backup("example", BackupArgs.builder()
.volumeId(exampleOntapVolume.id())
.build());
}
}
resources:
example:
type: aws:fsx:Backup
properties:
volumeId: ${exampleOntapVolume.id}
exampleOntapVolume:
type: aws:fsx:OntapVolume
name: example
properties:
name: example
junctionPath: /example
sizeInMegabytes: 1024
storageEfficiencyEnabled: true
storageVirtualMachineId: ${test.id}
The volumeId property references a specific ONTAP volume. Unlike file system backups, ONTAP backups operate at the volume level, allowing you to back up individual volumes within a multi-volume file system. This provides finer-grained recovery options.
Back up an OpenZFS file system
OpenZFS file systems provide ZFS features on AWS and need backups for data protection and cloning workflows.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleOpenZfsFileSystem = new aws.fsx.OpenZfsFileSystem("example", {
storageCapacity: 64,
subnetIds: [exampleAwsSubnet.id],
deploymentType: "SINGLE_AZ_1",
throughputCapacity: 64,
});
const example = new aws.fsx.Backup("example", {fileSystemId: exampleOpenZfsFileSystem.id});
import pulumi
import pulumi_aws as aws
example_open_zfs_file_system = aws.fsx.OpenZfsFileSystem("example",
storage_capacity=64,
subnet_ids=[example_aws_subnet["id"]],
deployment_type="SINGLE_AZ_1",
throughput_capacity=64)
example = aws.fsx.Backup("example", file_system_id=example_open_zfs_file_system.id)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/fsx"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleOpenZfsFileSystem, err := fsx.NewOpenZfsFileSystem(ctx, "example", &fsx.OpenZfsFileSystemArgs{
StorageCapacity: pulumi.Int(64),
SubnetIds: pulumi.StringArray{
exampleAwsSubnet.Id,
},
DeploymentType: pulumi.String("SINGLE_AZ_1"),
ThroughputCapacity: pulumi.Int(64),
})
if err != nil {
return err
}
_, err = fsx.NewBackup(ctx, "example", &fsx.BackupArgs{
FileSystemId: exampleOpenZfsFileSystem.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleOpenZfsFileSystem = new Aws.Fsx.OpenZfsFileSystem("example", new()
{
StorageCapacity = 64,
SubnetIds = new[]
{
exampleAwsSubnet.Id,
},
DeploymentType = "SINGLE_AZ_1",
ThroughputCapacity = 64,
});
var example = new Aws.Fsx.Backup("example", new()
{
FileSystemId = exampleOpenZfsFileSystem.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.fsx.OpenZfsFileSystem;
import com.pulumi.aws.fsx.OpenZfsFileSystemArgs;
import com.pulumi.aws.fsx.Backup;
import com.pulumi.aws.fsx.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) {
var exampleOpenZfsFileSystem = new OpenZfsFileSystem("exampleOpenZfsFileSystem", OpenZfsFileSystemArgs.builder()
.storageCapacity(64)
.subnetIds(exampleAwsSubnet.id())
.deploymentType("SINGLE_AZ_1")
.throughputCapacity(64)
.build());
var example = new Backup("example", BackupArgs.builder()
.fileSystemId(exampleOpenZfsFileSystem.id())
.build());
}
}
resources:
example:
type: aws:fsx:Backup
properties:
fileSystemId: ${exampleOpenZfsFileSystem.id}
exampleOpenZfsFileSystem:
type: aws:fsx:OpenZfsFileSystem
name: example
properties:
storageCapacity: 64
subnetIds:
- ${exampleAwsSubnet.id}
deploymentType: SINGLE_AZ_1
throughputCapacity: 64
The fileSystemId property references the OpenZFS file system. OpenZFS backups capture the entire file system including all datasets and snapshots at the time of backup creation.
Beyond these examples
These snippets focus on specific backup features: file system backups (Lustre, Windows, OpenZFS) and volume-level backups (ONTAP). They’re intentionally minimal rather than full backup strategies.
The examples reference pre-existing infrastructure such as FSx file systems or ONTAP volumes, VPC subnets for file system placement, and Active Directory for Windows file systems. They focus on creating backups rather than provisioning the underlying storage infrastructure.
To keep things focused, common backup patterns are omitted, including:
- Backup tagging and organization (tags)
- Encryption key management (kmsKeyId output)
- Automated backup schedules (requires separate configuration)
- Cross-region backup replication
These omissions are intentional: the goal is to illustrate how each backup type is wired, not provide drop-in backup modules. See the FSx Backup resource reference for all available configuration options.
Let's create AWS FSx Backups
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Configuration & File System Types
fileSystemId for backing up Lustre, Windows, and OpenZFS file systems. Use volumeId for backing up ONTAP volumes. Only one can be specified per backup.fileSystemId), and ONTAP volumes (using volumeId).fileSystemId for file system backups or volumeId for ONTAP volume backups, but not both.Immutability & Limitations
fileSystemId and volumeId are immutable. Changing either requires replacing the backup resource.Tags & Metadata
copy_tags_to_backups is enabled on the file system and you specify tags on the backup resource, existing file system tags won’t be copied. Either rely on automatic copying or explicitly specify all desired tags on the backup.