Skip to content
GitHubXDiscord

Snapshot

The Snapshot resource allows you to manage AWS FSx Snapshots for your Amazon FSx file systems, enabling you to create backups and restore your data efficiently.

Create a basic FSx snapshot with required properties and a tag.

import AWS from "alchemy/aws/control";
const fsxSnapshot = await AWS.FSx.Snapshot("myFsxSnapshot", {
volumeId: "vol-12345678",
name: "MyFirstSnapshot",
tags: [
{ key: "Environment", value: "Production" }
]
});

Configure a snapshot with additional properties, including adopting an existing resource.

const advancedFsxSnapshot = await AWS.FSx.Snapshot("advancedFsxSnapshot", {
volumeId: "vol-87654321",
name: "AdvancedSnapshot",
adopt: true,
tags: [
{ key: "Project", value: "Alpha" },
{ key: "Owner", value: "Team-X" }
]
});

Create a snapshot and then use it to restore the volume if needed.

import AWS from "alchemy/aws/control";
const recoverySnapshot = await AWS.FSx.Snapshot("recoverySnapshot", {
volumeId: "vol-12345678",
name: "RecoverySnapshot"
});
// Logic to restore the volume from the snapshot would go here

Create a snapshot with multiple tags for better organization in your AWS account.

const organizedSnapshot = await AWS.FSx.Snapshot("organizedSnapshot", {
volumeId: "vol-12345678",
name: "OrganizedSnapshot",
tags: [
{ key: "Department", value: "Finance" },
{ key: "BackupType", value: "Weekly" },
{ key: "RetentionPolicy", value: "30Days" }
]
});