Backup and Restore
Implement the lowest-cost DR tier by automating snapshots, S3 Cross-Region Replication, and AWS Backup policies, and walk through a restore drill.
Backup and Restore is a free AWS Solutions Architect lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Solutions Architect learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Backup and Restore Fundamentals
Backup and Restore is the simplest and most cost-effective disaster recovery strategy. You create regular backups of your data and infrastructure, store them in a durable location (typically S3 in another region), and restore from those backups when a disaster occurs. While cheap to maintain, it results in the longest RTO (hours) and potentially significant RPO (time since last backup). It is appropriate for non-critical workloads where downtime of several hours is acceptable.
# Backup and Restore workflow:
# 1. Create snapshots/backups on a schedule
# 2. Replicate backups to a secondary region
# 3. On disaster:
# a. Launch new infrastructure in DR region
# b. Restore data from most recent backup
# c. Update DNS to point to DR region
# 4. Failback when primary is restoredAWS Backup: Centralised Backup Management
AWS Backup is a fully managed service that centralises and automates data protection across AWS services. It supports EBS volumes, RDS databases, DynamoDB tables, EFS file systems, FSx, EC2 instances, Aurora clusters, and S3. You define backup plans with schedules, retention periods, and vault destinations. AWS Backup enforces backup policies across multiple accounts via AWS Organizations, making it the go-to service for enterprise backup management.
# Create AWS Backup vault
aws backup create-backup-vault \
--backup-vault-name production-dr-vault \
--encryption-key-arn arn:aws:kms:us-east-1:123:key/abc
# Assign resources to backup plan
aws backup create-backup-selection \
--backup-plan-id <plan-id> \
--backup-selection '{
"SelectionName": "all-production",
"IamRoleArn": "arn:aws:iam::123:role/BackupRole",
"ListOfTags": [{"ConditionType":"STRINGEQUALS","ConditionKey":"Environment","ConditionValue":"production"}]
}'RDS Automated Backups
Amazon RDS automatically creates daily snapshots and captures transaction logs to enable point-in-time recovery (PITR). You can restore your database to any second within the backup retention window (1-35 days). Automated backups are stored in S3 (managed by AWS, not visible in your S3 console). For cross-region DR, use the console or CLI to copy DB snapshots to another region — the copy can be used to launch a new RDS instance during a disaster.
# Copy RDS snapshot to DR region
aws rds copy-db-snapshot \
--source-db-snapshot-identifier arn:aws:rds:us-east-1:123:snapshot:rds:mydb-2026-06-21-05-00 \
--target-db-snapshot-identifier mydb-dr-2026-06-21 \
--region us-west-2 \
--copy-tags
# Restore in DR region from copied snapshot
aws rds restore-db-instance-from-db-snapshot \
--db-instance-identifier mydb-dr \
--db-snapshot-identifier mydb-dr-2026-06-21 \
--region us-west-2S3 Cross-Region Replication for Backups
S3 Cross-Region Replication (CRR) automatically replicates new objects from a source bucket to a destination bucket in another region. For backup purposes, configure your backup jobs to write to an S3 bucket with CRR enabled — backups are automatically copied to the DR region within minutes. Enable versioning on both buckets (required for CRR) so older backup versions are retained. Combine with S3 Object Lock to make backups immutable and protect against ransomware.
# Enable S3 bucket versioning (required for CRR)
aws s3api put-bucket-versioning \
--bucket my-backups-us-east-1 \
--versioning-configuration Status=Enabled
# Configure Cross-Region Replication
aws s3api put-bucket-replication \
--bucket my-backups-us-east-1 \
--replication-configuration '{
"Role": "arn:aws:iam::123:role/replication-role",
"Rules": [{
"Status": "Enabled",
"Destination": {
"Bucket": "arn:aws:s3:::my-backups-us-west-2",
"StorageClass": "STANDARD_IA"
}
}]
}'EC2 AMI Backups and Instance Recovery
To enable EC2 recovery in a DR region, pre-create Amazon Machine Images (AMIs) from your production EC2 instances and copy them to the DR region. AMIs capture the root volume, instance configuration, and optionally data volumes. In a disaster, launch new EC2 instances from the DR-region AMI and attach your restored EBS volumes. Automate AMI creation with AWS Backup EC2 resource type or EC2 Image Builder for golden image pipelines.
# Create AMI from running EC2 instance
aws ec2 create-image \
--instance-id i-1234567890abcdef0 \
--name 'prod-web-server-$(date +%Y%m%d)' \
--no-reboot
# Copy AMI to DR region
aws ec2 copy-image \
--source-region us-east-1 \
--source-image-id ami-12345678 \
--region us-west-2 \
--name 'prod-web-server-dr'DynamoDB Backups: On-Demand and PITR
DynamoDB offers two backup mechanisms. On-Demand backups create a full backup immediately with no performance impact — they can be retained indefinitely and restored in minutes. Point-In-Time Recovery (PITR), when enabled, continuously backs up your table for the last 35 days, allowing restore to any second in that window. Both backup types can be exported to S3 for cross-region backup or to integrate with AWS Backup. PITR is strongly recommended for production tables.
# Enable DynamoDB PITR
aws dynamodb update-continuous-backups \
--table-name Orders \
--point-in-time-recovery-specification PointInTimeRecoveryEnabled=true
# Restore to a specific point in time
aws dynamodb restore-table-to-point-in-time \
--source-table-name Orders \
--target-table-name Orders-DR-Restored \
--restore-date-time '2026-06-21T10:30:00.000Z'EFS Backups with AWS Backup
Amazon EFS integrates with AWS Backup for automated daily backups. EFS backups are incremental — only changed data is copied after the initial backup — making them storage-efficient. You can restore an entire file system or individual files from a backup. For cross-region DR, use AWS Backup Cross-Region Copy to automatically copy EFS backups to a vault in the DR region. Note that EFS itself is already Multi-AZ within a region; cross-region backup covers regional failure scenarios.
# AWS Backup plan with cross-region copy for EFS
{
'Rules': [{
'RuleName': 'daily-efs-backup',
'TargetBackupVaultName': 'primary-vault',
'ScheduleExpression': 'cron(0 5 ? * * *)',
'Lifecycle': {'DeleteAfterDays': 7},
'CopyActions': [{
'DestinationBackupVaultArn': 'arn:aws:backup:us-west-2:123:backup-vault:dr-vault',
'Lifecycle': {'DeleteAfterDays': 30}
}]
}]
}Backup Retention and Lifecycle Policies
Not all backups need to be kept forever. Design a retention strategy based on your RPO and compliance requirements. A common pattern: daily backups for 7 days, weekly backups for 4 weeks, monthly backups for 12 months, annual backups for 7 years (the Grandfather-Father-Son scheme). AWS Backup lifecycle rules automate this. For S3-stored backups, use S3 Lifecycle policies to transition older backups to S3 Glacier or Deep Archive to dramatically reduce storage costs.
# S3 lifecycle policy for backup files
aws s3api put-bucket-lifecycle-configuration \
--bucket my-backups \
--lifecycle-configuration '{
"Rules": [{
"ID": "backup-tiering",
"Status": "Enabled",
"Transitions": [
{"Days": 30, "StorageClass": "STANDARD_IA"},
{"Days": 90, "StorageClass": "GLACIER"},
{"Days": 365, "StorageClass": "DEEP_ARCHIVE"}
]
}]
}'Backup Vault Lock and Immutability
AWS Backup Vault Lock implements a WORM (Write Once, Read Many) policy that prevents anyone — including root users — from deleting backups or modifying the lock before its expiry. This protects backups from ransomware attacks and insider threats. Once applied, Vault Lock cannot be disabled. This feature is critical for compliance with regulations requiring immutable backups (SOC 2, PCI DSS, HIPAA). Set a minimum and maximum retention period to ensure backups are not deleted prematurely.
# Apply Backup Vault Lock
aws backup put-backup-vault-lock-configuration \
--backup-vault-name production-dr-vault \
--min-retention-days 7 \
--max-retention-days 365
# Note: Once locked, cannot be unlocked
# Use --changeable-for-days N during initial setup
# for a grace period to change configurationTesting Backup Restores
Creating backups is only half the job — you must regularly test that restores work correctly and within your RTO. AWS Backup supports restore testing plans that automatically restore backups to a test environment on a schedule and validate the restore succeeded. Without regular restore tests, you might discover during a real disaster that your backups are corrupted, incomplete, or take much longer to restore than expected. Document the restore time as your actual RTO data point.
# AWS Backup restore testing (available in newer API)
# Steps to manually test restore:
# 1. Identify most recent successful backup
aws backup list-recovery-points-by-backup-vault \
--backup-vault-name production-dr-vault \
--by-resource-type RDS
# 2. Start restore job
aws backup start-restore-job \
--recovery-point-arn arn:aws:rds:us-east-1:123:snapshot:mydb-recovery \
--iam-role-arn arn:aws:iam::123:role/BackupRestoreRole \
--resource-type RDS \
--metadata RecoveryPointId=...Backup Monitoring and Alerting
Backup failures must be detected immediately — a failed backup job means your next disaster has no recent recovery point. Configure AWS Backup notifications via SNS to alert on backup job failures. Use CloudWatch metrics like NumberOfBackupJobsFailed to create alarms. Use AWS Config rules like BACKUP_PLAN_MIN_FREQUENCY_AND_MIN_RETENTION_CHECK to continuously verify that resources have appropriate backup plans assigned. Treat a missed backup as a potential compliance violation.
# SNS notification for backup failures
aws backup put-backup-vault-notifications \
--backup-vault-name production-dr-vault \
--sns-topic-arn arn:aws:sns:us-east-1:123:backup-alerts \
--backup-vault-events \
BACKUP_JOB_FAILED \
RESTORE_JOB_FAILED \
COPY_JOB_FAILEDQuick Check
Test your understanding of AWS Solutions Architect (SAA-C03) concepts from this lesson.
Lesson Recap
In this lesson you learned: AWS Backup centralises backup management across RDS, DynamoDB, EFS, EC2, and more, S3 Cross-Region Replication automatically copies backups to your DR region, and Backup Vault Lock provides immutable backups for compliance and ransomware protection. Always test restores to validate your actual RTO. Next up we explore Pilot Light and Warm Standby strategies.
Frequently asked questions
Is the “Backup and Restore” lesson free?
Yes — the full text of “Backup and Restore” is free to read here on the web, and the AWS Solutions Architect course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Solutions Architect course, upgrade to CoddyKit PRO.
What will I learn in “Backup and Restore”?
Implement the lowest-cost DR tier by automating snapshots, S3 Cross-Region Replication, and AWS Backup policies, and walk through a restore drill. You practise AWS Solutions Architect with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AWS Solutions Architect?
No prior experience is required. AWS Solutions Architect on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Backup and Restore” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AWS Solutions Architect lesson?
Yes. Every AWS Solutions Architect lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.