Sub topic 13
Testing your DR plan
This chapter assumes you know RTO and RPO, the four DR strategies, and the failover pieces covered earlier: AWS Backup copies, Route 53 failover records, and scaling a standby fleet. A DR plan that has never been run is a guess. Testing turns it into a measured result.
What a test must prove
A test has to show that you can meet the targets you set. Check three things:
- Recovery time: the minutes from the decision to fail over until users are served from the DR Region. Compare this with your RTO.
- Data loss: the gap between the last write in the primary and the newest data in the DR Region. Compare this with your RPO.
- The runbook: the written steps work, the people can follow them, and the permissions and quotas exist in the DR Region.
Kinds of tests
Start small and grow. Each level costs more and teaches more.
| Test | What you do | What it finds |
|---|---|---|
| Tabletop | Walk through the runbook as a group, with no changes | Missing steps, unclear owners |
| Restore test | Restore a backup in the DR Region into a test environment | Corrupt or incomplete backups, restore duration |
| Component failover | Promote one replica or scale one fleet | Replication lag, quota limits |
| Full failover | Move real traffic to the DR Region | True RTO, hidden dependencies |
Common failures found in tests
- Quota gaps. The DR Region has lower EC2 limits than production, so scaling to full capacity fails.
- Missing copies. An AMI, secret, parameter, or KMS key was never copied to the DR Region.
- Hardcoded values. A config file points at a primary Region endpoint.
- Slow DNS. Clients cache answers longer than your TTL.
- Untested backups. A backup job succeeds, but nobody has proven the data restores.
Measure the restore
For backup and restore, time the restore itself. This command starts a restore job and returns a job ID. You then poll the job to read its duration.
aws backup describe-restore-job \
--region us-west-2 \
--restore-job-id "$RESTORE_JOB_ID" \
--query '{Status:Status,Created:CreationDate,Completed:CompletionDate}'Subtract Created from Completed, then add the time for the other runbook steps. That total is your measured RTO, which you compare with the target.
Test cycle
Good practice
- Write down the success criteria before the test, such as "serve traffic from us-west-2 within 30 minutes, with under 5 minutes of data loss."
- Run tests on a schedule, and after major changes to the architecture.
- Keep the runbook and infrastructure as code in version control, so the test runs the same steps a real event would.
- Plan failback too. A test is not done until traffic is back in the primary Region.
Exercise
Your backup jobs all report success, and your RTO is 4 hours. A restore test in the DR Region takes 6 hours to finish. What does this show, and what are two ways to respond?
Show answer
The plan does not meet the RTO, even though backups succeed. You can shorten the restore (for example, restore in parallel or use a smaller dataset per restore) or move to a faster strategy such as pilot light, where data is already replicated. You could also renegotiate the RTO if the business accepts it.