Skip to content

BackupSelection

Source: src/AWS/Backup/BackupSelection.ts

An AWS Backup selection — assigns AWS resources to a BackupPlan either by explicit ARN or by matching resource tags, using an IAM role that AWS Backup assumes to perform the backups.

A selection is immutable: any change to its name, role, or resource set replaces it.

Assign resources by tag

import * as Backup from "alchemy/AWS/Backup";
const selection = yield* Backup.BackupSelection("TaggedResources", {
backupPlanId: plan.backupPlanId,
iamRoleArn: backupRole.roleArn,
listOfTags: [
{
conditionType: "STRINGEQUALS",
conditionKey: "aws:ResourceTag/backup",
conditionValue: "daily",
},
],
});

Assign resources by ARN

const selection = yield* Backup.BackupSelection("ExplicitResources", {
backupPlanId: plan.backupPlanId,
iamRoleArn: backupRole.roleArn,
resources: [table.tableArn],
});