Skip to content

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).

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`);