Sub topic 4
Automating backups and cross-Region copies with AWS Backup
This chapter assumes you know what RTO and RPO mean, how the backup and restore strategy works, and how to read AWS CLI commands and JSON. It shows how to automate the backup step with AWS Backup so that a copy of your data exists in a second Region.
What AWS Backup manages
AWS Backup is a managed service that schedules, stores, and expires backups for many services from one place. It covers EBS, EC2, RDS, Aurora, DynamoDB, EFS, S3, and others. Three objects matter:
- A backup vault is a container that stores recovery points. Each vault belongs to one Region and one account.
- A backup plan holds one or more rules. Each rule sets a schedule, a lifecycle, a target vault, and optional copy actions.
- A resource assignment selects what the plan protects, either by resource ARN or by tag.
A recovery point is one backup of one resource. A copy action creates a second recovery point in a vault in another Region.
A plan with a cross-Region copy
The following plan runs daily at 05:00 UTC. It keeps the primary backup for 35 days and copies it to a vault named dr-vault in us-west-2.
{
"BackupPlanName": "dr-daily",
"Rules": [
{
"RuleName": "daily-with-cross-region-copy",
"TargetBackupVaultName": "Default",
"ScheduleExpression": "cron(0 5 * * ? *)",
"Lifecycle": { "DeleteAfterDays": 35 },
"CopyActions": [
{
"DestinationBackupVaultArn": "arn:aws:backup:us-west-2:111122223333:backup-vault:dr-vault",
"Lifecycle": { "DeleteAfterDays": 35 }
}
]
}
]
}Save the file as plan.json. Create the destination vault first, because the copy action fails if the vault does not exist. Then create the plan:
aws backup create-backup-vault --region us-west-2 --backup-vault-name dr-vault
aws backup create-backup-plan --region us-east-1 --backup-plan file://plan.jsonThe plan does nothing until you assign resources to it. Use aws backup create-backup-selection with the plan ID, an IAM role that AWS Backup can assume, and either resource ARNs or a tag condition such as backup=dr. Tag-based selection is easier to maintain, because new resources that carry the tag are protected automatically.
How the plan affects RPO and RTO
- RPO. The best case equals the schedule interval. A daily rule means you can lose up to 24 hours of data, plus the time the copy takes. For a lower RPO, use a more frequent schedule, or use continuous backup where the resource type supports it (for example RDS and S3 point-in-time recovery).
- RTO. The copy does not shorten restore time. After a disaster you still create the resources from the recovery point, which takes minutes to hours depending on data size.
- Lifecycle. The copy has its own lifecycle. Set it deliberately, because it controls both cost and how far back you can restore.
Common errors
- Missing KMS access. If the source recovery point is encrypted with a customer managed key, the copy needs a key it can use in the destination Region. Also check that the destination vault's key policy allows AWS Backup.
- Wrong role permissions. The IAM role in the selection needs the AWS managed backup and restore policies. A job that stays in a failed state often points to this.
- Untested restores. A successful backup job does not prove a restore works. Restore a recovery point into the DR Region regularly and time it.
- Vault in the same account. A copy into the same account does not protect you if the account is compromised. Consider a vault in a separate account with a vault lock for ransomware resilience.
Exercise
A team runs a backup rule every 12 hours and copies each recovery point to another Region. The copy takes about 1 hour. What is the worst-case data loss if the primary Region fails just before a new copy finishes?
Show answer
About 13 hours. The latest completed copy is up to 12 hours old, and the in-progress backup's 1-hour copy delay adds to the gap. So the effective RPO is the schedule interval plus the copy duration.