Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Implement disaster recovery strategies and runbooks. Configure RPO/RTO targets and failover procedures. Use when planning for business continuity.
license
MIT
metadata
{"author":"devops-skills","version":"1.0"}
Disaster Recovery
Implement disaster recovery strategies including RTO/RPO planning, AWS cross-region failover patterns, DR testing procedures, and automated failover scripts.
When to Use
Defining RTO and RPO targets for critical systems
Designing multi-region or multi-cloud disaster recovery architectures
Implementing automated failover and failback procedures
Conducting DR tests (tabletop, component, full failover)
Meeting compliance requirements for contingency planning (SOC 2, HIPAA, FedRAMP, ISO 27001)
RTO/RPO Planning
recovery_metrics:RTO:definition:"Recovery Time Objective - maximum acceptable downtime"measurement:"From incident declaration to service restoration"factors:-Failoverautomationmaturity-Datareplicationlag-DNSpropagationtime-Applicationwarm-uptime-VerificationproceduresRPO:definition:"Recovery Point Objective - maximum acceptable data loss"measurement:"Time gap between last good backup and the incident"factors:-Backupfrequency-Replicationmethod(syncvs.async)-Transactionlogshippinginterval-Cross-regionreplicationlagservice_tier_targets:tier_1_critical:examples:"Authentication, payment processing, core API"rto:"< 15 minutes"rpo:"< 1 minute (near-zero)"strategy:"Multi-site active-active or warm standby"replication:"Synchronous or near-synchronous"testing:"Quarterly failover test"tier_2_essential:examples:"Customer dashboards, reporting, notifications"rto:"< 1 hour"rpo:"< 15 minutes"strategy:"Warm standby or pilot light"replication:"Asynchronous with short interval"testing:"Semi-annual failover test"tier_3_standard:examples:"Internal tools, analytics, batch processing"rto:"< 4 hours"rpo:"< 1 hour"strategy:"Pilot light or backup and restore"replication:"Periodic snapshots"testing:"Annual failover test"tier_4_non_essential:examples:"Development environments, documentation sites"rto:"< 24 hours"rpo:"< 24 hours"strategy:"Backup and restore"replication:"Daily backups"testing:"Annual backup restore verification"
DR Strategies Comparison
strategies:backup_and_restore:rto:"Hours"rpo:"Hours (depends on backup frequency)"cost:"$"description:"Regular backups stored in DR region. Restore from backup when needed."aws_services:-"S3 cross-region replication for backups"-"RDS automated snapshots copied to DR region"-"AMI copies in DR region"-"Terraform/CloudFormation for infrastructure rebuild"pros:"Lowest cost, simplest to maintain"cons:"Longest recovery time, highest data loss potential"pilot_light:rto:"Minutes to hours"rpo:"Minutes"cost:"$$"description:"Core infrastructure running in DR region (databases replicated). Scale up compute on failover."aws_services:-"RDS cross-region read replica (always running)"-"S3 cross-region replication"-"AMIs pre-built in DR region"-"Auto Scaling groups at zero/minimal capacity"pros:"Fast database recovery, moderate cost"cons:"Compute scale-up adds to recovery time"warm_standby:
"Health check failed (attempt $i, status $STATUS), retrying..."
sleep
done
if
"$STATUS"
"200"
then
log
"ERROR: Health check failed after 10 attempts"
"ALERT: DR health check failing - manual intervention required"
exit
fi
# Step 4: Update DNS (if not using automatic Route53 failover)
log
"Step 4: DNS failover (Route53 automatic failover should handle this)"
log
"Verifying DNS resolution..."
log
"api.example.com resolves to: $DR_IP"
# Step 5: Verify end-to-end
log
"Step 5: End-to-end verification"
"https://api.example.com/health"
log
"Health response: $RESPONSE"
log
"=== DR Failover Complete ==="
"DR failover to $DR_REGION complete. Service restored."
# Generate failover report
cat
"/var/log/dr-failover-report-$(date +%Y%m%d).md"
EOF
# DR Failover Report
- **Date:** $(date -u +%Y-%m-%dT%H:%M:%SZ)
- **Primary Region:** $PRIMARY_REGION
- **DR Region:** $DR_REGION
- **RTO Actual:** Calculate from incident declaration
- **RPO Actual:** Check replication lag at time of incident
- **Status:** Operational in DR region
- **Actions Required:**
- [ ] Monitor error rates and latency
- [ ] Plan failback when primary region is restored
- [ ] Conduct post-incident review
EOF
-
Execute
failover
procedure
from
runbook
-
Measure
actual
RTO
and
RPO
-
Execute
failback
procedure
-
Document
results
output:
"Component test report with measured RTO/RPO"
full_failover:
frequency:
Annually
duration:
"4-8 hours (scheduled maintenance window)"
scope:
"Complete regional failover of all tier 1 and tier 2 services"
process:
1_preparation:
-
Schedule
maintenance
window
and
notify
stakeholders
-
Verify
DR
environment
is
healthy
-
Brief
all
participating
teams
-
Set
up
war
room
communication
channel
2_execute:
-
Simulate
primary
region
failure
-
Execute
failover
runbooks
for
all
services
-
Record
timestamps
at
each
milestone
3_verify:
-
Run
end-to-end
test
suite
against
DR
environment
-
Verify
data
consistency
-
Check
monitoring
and
alerting
in
DR
region
-
Confirm
external
integrations
work
4_failback:
-
Restore
primary
region
-
Re-establish
replication
-
Execute
failback
to
primary
-
Verify
data
consistency
post-failback
5_report:
-
Document
actual
RTO
and
RPO
for
each
service
-
Compare
against
targets
-
List
all
issues
encountered
-
Create
action
items
for
improvements
output:
"Full DR test report with measured vs. target metrics"