BackupPlan
Source:
src/AWS/Backup/BackupPlan.ts
An AWS Backup plan — a policy expression that defines when and how you want to back up your resources, composed of one or more scheduled rules that each target a backup vault.
Pair a plan with a BackupSelection to assign the AWS resources it
protects.
Creating a Plan
Section titled “Creating a Plan”Daily backups retained for 30 days
import * as Backup from "alchemy/AWS/Backup";
const vault = yield* Backup.BackupVault("AppBackups");
const plan = yield* Backup.BackupPlan("DailyPlan", { rules: [ { ruleName: "DailyBackups", targetBackupVaultName: vault.backupVaultName, scheduleExpression: "cron(0 5 ? * * *)", startWindow: "1 hour", completionWindow: "3 hours", lifecycle: { deleteAfter: "30 days" }, }, ],});Move to cold storage then delete
const plan = yield* Backup.BackupPlan("ArchivePlan", { rules: [ { ruleName: "MonthlyArchive", targetBackupVaultName: vault.backupVaultName, scheduleExpression: "cron(0 5 1 * ? *)", lifecycle: { moveToColdStorageAfter: "30 days", deleteAfter: "365 days", }, }, ],});