Repository navigation
AWS Backup — Tag-based Resource Filtering Not Working as Expected #35858
Replies: 1 comment
|
Hi @vaibhavrajchauhan-crx! You have run directly into one of the most notorious gotchas in AWS Backup: Here is the exact explanation of why this happens and how to achieve strict Service + Tag filtering: The Underlying Problem:
|
| Resource | Tag Key | Tag Value |
|---|---|---|
| S3 Buckets | BackupPlan-S3 |
DAILY |
| RDS Databases | BackupPlan-RDS |
DAILY |
| EC2 Instances | BackupPlan-EC2 |
DAILY |
Then, configure standard tag selections in your CDK plans:
// S3 Backup Plan
s3Plan.addSelection('S3Selection', {
resources: [
backup.BackupResource.fromTag('BackupPlan-S3', 'DAILY'),
],
});
// RDS Backup Plan
rdsPlan.addSelection('RdsSelection', {
resources: [
backup.BackupResource.fromTag('BackupPlan-RDS', 'DAILY'),
],
});Why this works best:
- Zero ambiguity: An EC2 instance tagged
BackupPlan-EC2=DAILYcan never be selected by the S3 backup plan. - Allows resources to have different schedules (e.g. S3 Daily, RDS Hourly) without tag collisions.
If this clarifies the OR evaluation behavior and helps you isolate backups to their respective vaults, please feel free to mark this as the accepted answer!
Uh oh!
There was an error while loading. Please reload this page.
AWS Backup: Restricting Backups by Service and Tags
I’m setting up AWS Backup to take service-specific backups, where each AWS service (S3, EC2, RDS, DDB, EBS) has its own backup plan and vault.
🎯 Goal
Each backup plan should only back up resources that:
Belong to a specific service, and
Have specific tags
Example:
🧩 What I’ve Tried
1. Resource ARN–based Selection
Added only S3 ARNs with tag
BACKUP=DAILYResult: AWS Backup still backed up all resources (EC2, RDS, etc.) that shared the same tag.
2. Tag-based Selection (No ARNs)
Removed ARNs and used tag filters only:
Result: AWS Backup still included all resources with the
BACKUP=DAILYtag, regardless of type.📄 AWS Documentation Statement
Even though all tag conditions are satisfied, AWS Backup does not seem to limit selection by service type, leading to cross-service backups.
Even with multiple tag filters applied, AWS Backup is including all tagged resources (across EC2, S3, RDS, etc.) in every plan — causing duplicate backups across multiple vaults.
❓Question
How can I configure AWS Backup so that:
Each backup plan is restricted to a specific service (e.g., only S3), and
Only backs up resources with specific tags (like
BACKUP=DAILY,RESOURCE=S3)?Is there a correct or recommended way to limit backups by both service type and tags?
All reactions