AWS.FSx reference
CancelDataRepositoryTask
Section titled “CancelDataRepositoryTask”Source:
src/AWS/FSx/CancelDataRepositoryTask.ts
Runtime binding for the CancelDataRepositoryTask operation (IAM action
fsx:CancelDataRepositoryTask on * — runtime-created tasks have ARNs
unknowable at deploy time).
Cancels a PENDING or EXECUTING Lustre data repository task started
with CreateDataRepositoryTask. A task that already finished
surfaces the typed DataRepositoryTaskEnded. Provide the implementation
with Effect.provide(AWS.FSx.CancelDataRepositoryTaskHttp).
CancelDataRepositoryTask: Data Repository Tasks
Section titled “CancelDataRepositoryTask: Data Repository Tasks”const cancelDataRepositoryTask = yield* AWS.FSx.CancelDataRepositoryTask();
yield* cancelDataRepositoryTask({ TaskId: taskId }).pipe( Effect.catchTag("DataRepositoryTaskEnded", () => Effect.void),);CopyBackup
Section titled “CopyBackup”Source:
src/AWS/FSx/CopyBackup.ts
Runtime binding for the CopyBackup operation (IAM actions
fsx:CopyBackup + fsx:TagResource on * — both the source and the new
backup’s ARNs are unknowable at deploy time).
Copies an FSx backup within a region or from another region — the
cross-region disaster-recovery half of a runtime backup rotation built
with CreateBackup. A missing source backup surfaces the typed
BackupNotFound. Provide the implementation with
Effect.provide(AWS.FSx.CopyBackupHttp).
CopyBackup: Managing Backups at Runtime
Section titled “CopyBackup: Managing Backups at Runtime”const copyBackup = yield* AWS.FSx.CopyBackup();
const copy = yield* copyBackup({ SourceBackupId: backup.BackupId!, SourceRegion: "us-east-1",});CopySnapshotAndUpdateVolume
Section titled “CopySnapshotAndUpdateVolume”Source:
src/AWS/FSx/CopySnapshotAndUpdateVolume.ts
Runtime binding for the CopySnapshotAndUpdateVolume operation (IAM
action fsx:CopySnapshotAndUpdateVolume on *).
Updates an existing FSx for OpenZFS volume from a snapshot on another FSx
for OpenZFS file system (on-demand data replication) — the cross-file-system
counterpart of RestoreVolumeFromSnapshot. Provide the
implementation with Effect.provide(AWS.FSx.CopySnapshotAndUpdateVolumeHttp).
CopySnapshotAndUpdateVolume: Managing Snapshots at Runtime
Section titled “CopySnapshotAndUpdateVolume: Managing Snapshots at Runtime”const copySnapshotAndUpdateVolume = yield* AWS.FSx.CopySnapshotAndUpdateVolume();
const response = yield* copySnapshotAndUpdateVolume({ VolumeId: volumeId, SourceSnapshotARN: sourceSnapshot.ResourceARN!, CopyStrategy: "INCREMENTAL_COPY",});yield* Effect.log(`volume ${response.VolumeId} updating`);CreateBackup
Section titled “CreateBackup”Source:
src/AWS/FSx/CreateBackup.ts
Runtime binding for the CreateBackup operation scoped to one file system
(IAM actions fsx:CreateBackup and fsx:TagResource on the file system
ARN and on arn:aws:fsx:*:*:backup/* — the new backup’s ARN is unknowable
at deploy time).
Takes a user-initiated backup of the bound FileSystem — e.g.
before a risky data migration, or on an application-defined cadence
richer than the daily automatic backup. Pass a ClientRequestToken to
make the call idempotent. A backup already in progress surfaces the typed
BackupInProgress. Provide the implementation with
Effect.provide(AWS.FSx.CreateBackupHttp).
CreateBackup: Managing Backups at Runtime
Section titled “CreateBackup: Managing Backups at Runtime”const createBackup = yield* AWS.FSx.CreateBackup(files);
const response = yield* createBackup({ ClientRequestToken: `migration-${migrationId}`, Tags: [{ Key: "reason", Value: "pre-migration" }],});yield* Effect.log(`backup ${response.Backup?.BackupId} started`);CreateDataRepositoryTask
Section titled “CreateDataRepositoryTask”Source:
src/AWS/FSx/CreateDataRepositoryTask.ts
Runtime binding for the CreateDataRepositoryTask operation scoped to one
Lustre file system (IAM actions fsx:CreateDataRepositoryTask and
fsx:TagResource on the file system ARN and on arn:aws:fsx:*:*:task/*).
Starts a bulk data movement between the bound Lustre FileSystem
and its linked S3 data repository — EXPORT_TO_REPOSITORY,
IMPORT_METADATA_FROM_REPOSITORY, or RELEASE_DATA_FROM_FILESYSTEM —
from inside a function runtime, e.g. exporting results after a compute
job completes. A task already executing surfaces the typed
DataRepositoryTaskExecuting. Provide the implementation with
Effect.provide(AWS.FSx.CreateDataRepositoryTaskHttp).
CreateDataRepositoryTask: Data Repository Tasks
Section titled “CreateDataRepositoryTask: Data Repository Tasks”const createDataRepositoryTask = yield* AWS.FSx.CreateDataRepositoryTask(scratch);
const response = yield* createDataRepositoryTask({ Type: "EXPORT_TO_REPOSITORY", Paths: ["results/"], Report: { Enabled: false },});yield* Effect.log(`task ${response.DataRepositoryTask?.TaskId} started`);CreateSnapshot
Section titled “CreateSnapshot”Source:
src/AWS/FSx/CreateSnapshot.ts
Runtime binding for the CreateSnapshot operation (IAM actions
fsx:CreateSnapshot and fsx:TagResource on * — snapshots target
OpenZFS volumes whose ARNs are typically runtime values).
Takes a point-in-time snapshot of an FSx for OpenZFS volume — e.g.
before applying a batch of writes so they can be rolled back with
RestoreVolumeFromSnapshot. Pass a ClientRequestToken to make
the call idempotent. Provide the implementation with
Effect.provide(AWS.FSx.CreateSnapshotHttp).
CreateSnapshot: Managing Snapshots at Runtime
Section titled “CreateSnapshot: Managing Snapshots at Runtime”const createSnapshot = yield* AWS.FSx.CreateSnapshot();
const response = yield* createSnapshot({ Name: "pre-batch-42", VolumeId: volumeId,});yield* Effect.log(`snapshot ${response.Snapshot?.SnapshotId} started`);DeleteBackup
Section titled “DeleteBackup”Source:
src/AWS/FSx/DeleteBackup.ts
Runtime binding for the DeleteBackup operation (IAM action
fsx:DeleteBackup on * — runtime-created backups have ARNs unknowable
at deploy time).
Deletes an FSx backup by id — the teardown half of a runtime backup
rotation built with CreateBackup. Deleting an already-deleted
backup surfaces the typed BackupNotFound. Provide the implementation
with Effect.provide(AWS.FSx.DeleteBackupHttp).
DeleteBackup: Managing Backups at Runtime
Section titled “DeleteBackup: Managing Backups at Runtime”const deleteBackup = yield* AWS.FSx.DeleteBackup();
yield* deleteBackup({ BackupId: expired.BackupId! }).pipe( Effect.catchTag("BackupNotFound", () => Effect.void),);DeleteSnapshot
Section titled “DeleteSnapshot”Source:
src/AWS/FSx/DeleteSnapshot.ts
Runtime binding for the DeleteSnapshot operation (IAM action
fsx:DeleteSnapshot on * — runtime-created snapshots have ARNs
unknowable at deploy time).
Deletes an FSx for OpenZFS snapshot by id — the teardown half of a
runtime snapshot rotation built with CreateSnapshot. Deleting an
already-deleted snapshot surfaces the typed SnapshotNotFound. Provide
the implementation with Effect.provide(AWS.FSx.DeleteSnapshotHttp).
DeleteSnapshot: Managing Snapshots at Runtime
Section titled “DeleteSnapshot: Managing Snapshots at Runtime”const deleteSnapshot = yield* AWS.FSx.DeleteSnapshot();
yield* deleteSnapshot({ SnapshotId: old.SnapshotId! }).pipe( Effect.catchTag("SnapshotNotFound", () => Effect.void),);DescribeBackups
Section titled “DescribeBackups”Source:
src/AWS/FSx/DescribeBackups.ts
Runtime binding for the DescribeBackups operation (IAM action
fsx:DescribeBackups on *).
Lists FSx backups — optionally filtered by file-system-id,
backup-type, or explicit BackupIds — from inside a function runtime.
Pairs with CreateBackup to poll a runtime-initiated backup until
it reaches AVAILABLE. Provide the implementation with
Effect.provide(AWS.FSx.DescribeBackupsHttp).
DescribeBackups: Managing Backups at Runtime
Section titled “DescribeBackups: Managing Backups at Runtime”const describeBackups = yield* AWS.FSx.DescribeBackups();
const response = yield* describeBackups({ Filters: [{ Name: "file-system-id", Values: [fileSystemId] }],});yield* Effect.log(`${response.Backups?.length ?? 0} backups`);DescribeDataRepositoryAssociations
Section titled “DescribeDataRepositoryAssociations”Source:
src/AWS/FSx/DescribeDataRepositoryAssociations.ts
Runtime binding for the DescribeDataRepositoryAssociations operation
(IAM action fsx:DescribeDataRepositoryAssociations on *).
Lists the S3 data repository associations linked to Lustre file systems —
optionally filtered by file-system-id — from inside a function runtime,
e.g. to discover the S3 prefix a CreateDataRepositoryTask export
will land in. Provide the implementation with
Effect.provide(AWS.FSx.DescribeDataRepositoryAssociationsHttp).
DescribeDataRepositoryAssociations: Data Repository Tasks
Section titled “DescribeDataRepositoryAssociations: Data Repository Tasks”const describeDataRepositoryAssociations = yield* AWS.FSx.DescribeDataRepositoryAssociations();
const response = yield* describeDataRepositoryAssociations({ Filters: [{ Name: "file-system-id", Values: [fileSystemId] }],});yield* Effect.log(response.Associations?.[0]?.DataRepositoryPath);DescribeDataRepositoryTasks
Section titled “DescribeDataRepositoryTasks”Source:
src/AWS/FSx/DescribeDataRepositoryTasks.ts
Runtime binding for the DescribeDataRepositoryTasks operation (IAM
action fsx:DescribeDataRepositoryTasks on *).
Lists Lustre data repository tasks — optionally filtered by
file-system-id or task-lifecycle, or by explicit TaskIds — from
inside a function runtime. Pairs with CreateDataRepositoryTask to
poll an export/import task until it reaches SUCCEEDED. Provide the
implementation with
Effect.provide(AWS.FSx.DescribeDataRepositoryTasksHttp).
DescribeDataRepositoryTasks: Data Repository Tasks
Section titled “DescribeDataRepositoryTasks: Data Repository Tasks”const describeDataRepositoryTasks = yield* AWS.FSx.DescribeDataRepositoryTasks();
const response = yield* describeDataRepositoryTasks({ TaskIds: [taskId],});yield* Effect.log(response.DataRepositoryTasks?.[0]?.Lifecycle);DescribeFileSystem
Section titled “DescribeFileSystem”Source:
src/AWS/FSx/DescribeFileSystem.ts
Runtime binding for the DescribeFileSystems operation scoped to one file
system (IAM action fsx:DescribeFileSystems on the file system ARN).
Reads the bound FileSystem’s live description — lifecycle state,
storage capacity, DNS name, engine configuration — from inside a function
runtime. Useful for storage dashboards and capacity monitors. Provide the
implementation with Effect.provide(AWS.FSx.DescribeFileSystemHttp).
DescribeFileSystem: Inspecting File Systems
Section titled “DescribeFileSystem: Inspecting File Systems”// init — bind the operation to the file systemconst describeFileSystem = yield* AWS.FSx.DescribeFileSystem(files);
// runtimeconst response = yield* describeFileSystem();const fs = response.FileSystems?.[0];yield* Effect.log(`${fs?.Lifecycle}: ${fs?.StorageCapacity} GiB`);DescribeSnapshots
Section titled “DescribeSnapshots”Source:
src/AWS/FSx/DescribeSnapshots.ts
Runtime binding for the DescribeSnapshots operation (IAM action
fsx:DescribeSnapshots on *).
Lists FSx for OpenZFS snapshots — optionally filtered by volume-id or
file-system-id — from inside a function runtime. Pairs with
CreateSnapshot to poll a runtime-initiated snapshot until it
reaches AVAILABLE. Provide the implementation with
Effect.provide(AWS.FSx.DescribeSnapshotsHttp).
DescribeSnapshots: Managing Snapshots at Runtime
Section titled “DescribeSnapshots: Managing Snapshots at Runtime”const describeSnapshots = yield* AWS.FSx.DescribeSnapshots();
const response = yield* describeSnapshots({ Filters: [{ Name: "volume-id", Values: [volumeId] }],});yield* Effect.log(`${response.Snapshots?.length ?? 0} snapshots`);DescribeStorageVirtualMachines
Section titled “DescribeStorageVirtualMachines”Source:
src/AWS/FSx/DescribeStorageVirtualMachines.ts
Runtime binding for the DescribeStorageVirtualMachines operation (IAM
action fsx:DescribeStorageVirtualMachines on *).
Lists FSx for ONTAP storage virtual machines (SVMs) — optionally filtered
by file-system-id — from inside a function runtime, e.g. to resolve an
SVM’s endpoints before opening an iSCSI/NFS session. Provide the
implementation with
Effect.provide(AWS.FSx.DescribeStorageVirtualMachinesHttp).
DescribeStorageVirtualMachines: Inspecting File Systems
Section titled “DescribeStorageVirtualMachines: Inspecting File Systems”const describeStorageVirtualMachines = yield* AWS.FSx.DescribeStorageVirtualMachines();
const response = yield* describeStorageVirtualMachines({ Filters: [{ Name: "file-system-id", Values: [fileSystemId] }],});yield* Effect.log( `${response.StorageVirtualMachines?.length ?? 0} SVMs`,);DescribeVolumes
Section titled “DescribeVolumes”Source:
src/AWS/FSx/DescribeVolumes.ts
Runtime binding for the DescribeVolumes operation (IAM action
fsx:DescribeVolumes on *).
Lists FSx for ONTAP / OpenZFS volumes — optionally filtered by
file-system-id or storage-virtual-machine-id — from inside a function
runtime. Useful for discovering the volume ids that the snapshot bindings
operate on. Provide the implementation with
Effect.provide(AWS.FSx.DescribeVolumesHttp).
DescribeVolumes: Inspecting File Systems
Section titled “DescribeVolumes: Inspecting File Systems”const describeVolumes = yield* AWS.FSx.DescribeVolumes();
const response = yield* describeVolumes({ Filters: [{ Name: "file-system-id", Values: [fileSystemId] }],});yield* Effect.log(`${response.Volumes?.length ?? 0} volumes`);FileSystem
Section titled “FileSystem”Source:
src/AWS/FSx/FileSystem.ts
An Amazon FSx file system — fully-managed shared storage for Lustre, Windows File Server, NetApp ONTAP, or OpenZFS.
FSx file systems take several minutes to provision. The file system id,
ARN, and DNS name are returned as soon as CreateFileSystem accepts the
request; the file system then transitions CREATING → AVAILABLE
asynchronously. Create is idempotent on a deterministic client request
token derived from the app, stage, and logical id; if state is lost, the
file system is re-discovered by its internal Alchemy tags.
FileSystem: Creating File Systems
Section titled “FileSystem: Creating File Systems”Lustre scratch file system (cheapest / fastest)
import * as AWS from "alchemy/AWS";
const scratch = yield* AWS.FSx.FileSystem("Scratch", { fileSystemType: "LUSTRE", storageCapacity: 1200, subnetIds: [subnetId], lustreConfiguration: { DeploymentType: "SCRATCH_2" },});Persistent Lustre with S3 data repository
const files = yield* AWS.FSx.FileSystem("Files", { fileSystemType: "LUSTRE", storageCapacity: 1200, subnetIds: [subnetId], lustreConfiguration: { DeploymentType: "PERSISTENT_2", PerUnitStorageThroughput: 125, DataCompressionType: "LZ4", },});OpenZFS file system
const zfs = yield* AWS.FSx.FileSystem("Zfs", { fileSystemType: "OPENZFS", storageCapacity: 64, subnetIds: [subnetId], openZFSConfiguration: { DeploymentType: "SINGLE_AZ_1", ThroughputCapacity: 64, },});ReleaseFileSystemNfsV3Locks
Section titled “ReleaseFileSystemNfsV3Locks”Source:
src/AWS/FSx/ReleaseFileSystemNfsV3Locks.ts
Runtime binding for the ReleaseFileSystemNfsV3Locks operation scoped to
one OpenZFS file system (IAM action fsx:ReleaseFileSystemNfsV3Locks on
the file system ARN).
Releases all NFSv3 byte-range locks held on the bound OpenZFS
FileSystem — the recovery action for clients that crashed while
holding locks and left files stuck. Provide the implementation with
Effect.provide(AWS.FSx.ReleaseFileSystemNfsV3LocksHttp).
ReleaseFileSystemNfsV3Locks: Operational Recovery
Section titled “ReleaseFileSystemNfsV3Locks: Operational Recovery”const releaseLocks = yield* AWS.FSx.ReleaseFileSystemNfsV3Locks(zfs);
const response = yield* releaseLocks();yield* Effect.log(`file system ${response.FileSystem?.FileSystemId} locks released`);RestoreVolumeFromSnapshot
Section titled “RestoreVolumeFromSnapshot”Source:
src/AWS/FSx/RestoreVolumeFromSnapshot.ts
Runtime binding for the RestoreVolumeFromSnapshot operation (IAM action
fsx:RestoreVolumeFromSnapshot on *).
Rolls an FSx for OpenZFS volume back to the state saved by a snapshot —
the undo half of the runtime snapshot pattern built with
CreateSnapshot. Pass Options: ["DELETE_INTERMEDIATE_SNAPSHOTS"]
to roll back past newer snapshots. Provide the implementation with
Effect.provide(AWS.FSx.RestoreVolumeFromSnapshotHttp).
RestoreVolumeFromSnapshot: Managing Snapshots at Runtime
Section titled “RestoreVolumeFromSnapshot: Managing Snapshots at Runtime”const restoreVolumeFromSnapshot = yield* AWS.FSx.RestoreVolumeFromSnapshot();
const response = yield* restoreVolumeFromSnapshot({ VolumeId: volumeId, SnapshotId: snapshot.SnapshotId!,});yield* Effect.log(`volume ${response.VolumeId} restoring`);UpdateSnapshot
Section titled “UpdateSnapshot”Source:
src/AWS/FSx/UpdateSnapshot.ts
Runtime binding for the UpdateSnapshot operation (IAM action
fsx:UpdateSnapshot on * — runtime-created snapshots have ARNs
unknowable at deploy time).
Renames an OpenZFS volume snapshot — the management half of a runtime
snapshot rotation built with CreateSnapshot. A missing snapshot
surfaces the typed UpdateSnapshotNotFound (FSx reports it as a wire
BadRequest; the distilled patch carves out the typed tag by message).
Provide the implementation with
Effect.provide(AWS.FSx.UpdateSnapshotHttp).
UpdateSnapshot: Managing Snapshots at Runtime
Section titled “UpdateSnapshot: Managing Snapshots at Runtime”const updateSnapshot = yield* AWS.FSx.UpdateSnapshot();
yield* updateSnapshot({ SnapshotId: snapshot.SnapshotId!, Name: "nightly-promoted",});