Sub topic 13
Testing your DR plan
This chapter assumes you know the four DR strategies (backup and restore, pilot light, warm standby, multi-site active/active) and the meaning of RTO and RPO. It also assumes you have read the failover and failback chapter, because a DR test is mostly a rehearsal of that runbook. You should be comfortable with the AWS CLI, Route 53 health checks, and basic Auto Scaling.
Why an untested plan is only a hypothesis
A DR plan lists steps that you expect to restore service within your RTO and RPO. Until you run those steps, you do not know whether they work. Common failures found only during real recoveries include:
- A backup that exists but cannot be restored, because it is encrypted with a KMS key the DR Region cannot use.
- A CloudFormation or Terraform template that references an AMI ID, a subnet ID, or a secret that exists only in the primary Region.
- Service quotas in the DR Region that are lower than production needs, so scaling to full capacity fails.
- A runbook step that depends on a person who is unavailable, or on a tool hosted in the failed Region.
- A DNS TTL or client cache that keeps traffic going to the dead endpoint longer than the RTO allows.
Testing turns these surprises into tickets you fix on a calm afternoon instead of during an outage.
What a DR test must prove
Each test should check a measurable claim. Write the claims before you run anything.
| Claim | How to measure it |
|---|---|
| Data can be restored | Restore completes and a known record or checksum is present |
| RPO is met | Compare the newest recovered record's timestamp with the time of the simulated failure |
| RTO is met | Time from the declared disaster to a successful end-to-end request in the DR Region |
| The runbook is complete | A person who did not write it can follow it without asking questions |
| Failback works | Production returns to the primary Region with no data loss |
Measured RTO includes detection and decision time, not only the technical steps. Start your stopwatch when the failure begins, not when someone opens the runbook.
Types of DR tests
Tests range from cheap and safe to realistic and risky. A mature program uses several.
- Tabletop exercise. The team walks through a scenario on paper or in a meeting. It finds gaps in ownership, communication, and decision rules. It cannot find technical defects.
- Backup restore test. You restore a backup into an isolated environment and validate the data. This is the minimum for any strategy.
- Component test. You exercise one recovery step, such as promoting a read replica or scaling the DR Auto Scaling group.
- Full failover test. You shift real or synthetic traffic to the DR Region and run there. This is the only test that proves the whole chain.
- Game day with fault injection. You inject a failure into the primary on purpose and watch whether recovery happens as designed.
Testing each strategy
What you test depends on what is running in the DR Region.
| Strategy | Focus of the test |
|---|---|
| Backup and restore | Restore from the cross-Region copy, rebuild infrastructure from code, and time the whole sequence |
| Pilot light | Scale the dormant compute, promote the replicated database, and confirm the application starts against it |
| Warm standby | Scale the standby to production size, switch traffic, and run a load test at full volume |
| Multi-site active/active | Remove one Region from rotation and confirm the survivor absorbs the load |
For backup and restore, the restore time dominates the RTO, and it grows with data size. A restore that took 20 minutes with a small test database may take hours with production data, so test with production-sized data.
For pilot light and warm standby, the usual failure is capacity. Scaling an Auto Scaling group from a minimum size to production size depends on instance availability and quotas in the DR Region. Run the scale-up from your runbook and confirm it reaches the target:
# Scale the dormant DR Auto Scaling group up from its minimal size
aws autoscaling update-auto-scaling-group \
--region us-west-2 \
--auto-scaling-group-name app-dr \
--min-size 4 \
--desired-capacity 4 \
--max-size 12
# Watch until all four instances are InService
aws autoscaling describe-auto-scaling-groups \
--region us-west-2 \
--auto-scaling-group-names app-dr \
--query "AutoScalingGroups[0].Instances[].LifecycleState"For multi-site active/active, the risk is not starting a Region but surviving without one. Test whether the remaining Region has capacity for 100 percent of traffic, and whether write conflicts or replication lag cause errors.
Validating backups
AWS Backup can run restore testing on a schedule. A restore testing plan restores selected recovery points into a temporary resource, runs a validation window, then deletes the restored resource. This checks that backups are usable without a manual project each time. You can also validate by hand: restore to a new resource, run a query or checksum, and compare the result with the source.
For database replication, check lag as part of every test. For an Aurora global database, the replication lag metric shows how far the secondary trails the primary, and that lag is your real RPO at any moment. Record it at the time of the test, not just the target.
Testing traffic failover
Route 53 failover depends on a health check marking the primary unhealthy and on resolvers honoring the record TTL. In the failover record set from the earlier chapter, the TTL is 60 seconds, so some clients may keep using the old answer for about a minute after the switch, and some resolvers ignore low TTLs.
To test without breaking production, you have several options:
- Point the health check at a dedicated path such as
/health/dr-testthat you can make fail on demand. - Invert the health check temporarily in a non-production hosted zone that mirrors your records.
- Use a test hostname with the same failover configuration and measure how long clients take to move.
Measure from outside AWS, because a client in the failed Region tells you little. Record when the health check changed state, when the DNS answer changed, and when the first successful request reached the DR Region.
Using fault injection
AWS Fault Injection Service (FIS) runs controlled experiments such as stopping instances, disrupting network connectivity, or throttling APIs. You define an experiment template with targets, actions, and stop conditions. Stop conditions are CloudWatch alarms that end the experiment automatically if impact exceeds what you accepted.
A sound experiment follows this order:
- State a hypothesis, for example "if the primary Region's instances stop, users see recovery within 15 minutes."
- Define the blast radius and the stop condition.
- Run the experiment in a pre-production environment first.
- Compare measured results to the hypothesis.
- Fix what you found and repeat.
Running a test: a practical sequence
Follow these steps for each test:
- Define scope, success criteria, and stop conditions, and notify stakeholders.
- Capture a baseline: replication lag, latest backup time, and current capacity.
- Start the clock when you simulate the failure.
- Follow the written runbook exactly. If someone improvises, update the runbook afterward.
- Validate with synthetic requests that exercise real paths, including login, a write, and a read.
- Record RTO, RPO, and every deviation.
- Fail back, and verify the primary is consistent.
- Open tickets for each finding, assign owners, and set a date to retest.
Common mistakes
- Testing only backups. A restored database does not prove the application, DNS, secrets, and permissions work together.
- Testing with small data. Restore and replication times scale with size.
- Skipping failback. Many teams reach the DR Region and cannot return cleanly. Rehearse the return trip.
- Using the console from memory. Real events happen under stress. Use scripts or infrastructure as code, and keep the runbook outside the failed Region, for example in a different Region or a system with no dependency on the primary.
- Never retesting. Infrastructure, quotas, and code drift. Test on a schedule, such as quarterly, and after major changes.
- Ignoring cost. Full failover tests run real resources. Plan the duration and delete test resources afterward.
Keeping results useful
Write a short report after each test with the date, scenario, measured RTO and RPO against targets, findings, owners, and deadlines. Track whether the same findings recur. If the measured RTO is above the target, you have two options: improve the procedure, or move to a strategy that costs more and recovers faster. The strategy selection chapter uses these measurements as input.
Exercise
Your pilot light workload has an RTO of 30 minutes. In a test, the database promotion takes 5 minutes, DNS propagation takes 2 minutes, and scaling the Auto Scaling group takes 12 minutes. Your team also took 15 minutes to detect the failure and agree to fail over. Did the test meet the RTO, and what should the team do?
Show answer
Total time is 15 + 5 + 2 + 12 = 34 minutes, which misses the 30-minute RTO. Because RTO includes detection and decision time, the team should reduce it. Options are alarms that page on-call automatically, a pre-approved decision rule for failover, pre-warmed capacity (moving toward warm standby), or parallel execution of the database promotion and the scale-up. Then retest.
Exercise
Why is a "Completed" status on an AWS Backup job not enough evidence that your backup and restore strategy works?
Show answer
The status only shows that data was written. It does not show that the data can be restored, that the KMS key is usable in the DR Region, that the restored data is consistent, or that the restore finishes within the RTO. Only a restore test with validation proves these things.