Project 3: A Resilient Web Application With Multi-AZ, Backups, Cross-Region DR and an Operations Runbook
Requirements
| Requirement | Target |
|---|---|
| Availability | 99.9 percent, survive the loss of one AZ with no manual action |
| DR | Region failure: RTO 1 hour, RPO 5 minutes (pilot light with cross-Region replica) |
| Security | Private app and data subnets, encryption everywhere, WAF, least privilege, no SSH |
| Operations | Patching, alarms, dashboards, runbooks, cost budget |
| Delivery | Everything as code (CloudFormation or CDK) in both Regions |
Architecture
text
Users ─► Route 53 (failover, health checks) ─► CloudFront + WAF ─► ALB (3 AZs)
PRIMARY Region (ap-south-1) DR Region (ap-southeast-1) — pilot light
Public subnets : ALB, NAT per AZ ALB + ASG min=0 (AMIs copied, launch template ready)
Private app : ASG (min 3 across 3 AZs, SSM) Aurora Global Database secondary cluster (1 small replica)
Private data : Aurora cluster (writer + 2 readers) S3 replica bucket (CRR), secrets replicas, multi-Region KMS key
ElastiCache (Multi-AZ), S3 (assets, CRR) ────────────► AWS Backup vault (cross-Region copy, vault lock)
Observability: CloudWatch alarms/dashboard · SNS · EventBridge · X-Ray · Config · GuardDuty · Budgets
Step 1: Network and Compute (Primary)
- VPC
10.0.0.0/16, 3 AZs, public/app/data subnets, one NAT gateway per AZ, S3 and DynamoDB gateway endpoints, SSM/Logs/ECR interface endpoints - ALB in public subnets with ACM certificate and HTTP→HTTPS redirect. Security groups chained: ALB → app → database
- ASG with launch template (AMI from Image Builder, IMDSv2, instance profile), **target tracking on
ALBRequestCountPerTarget**,HealthCheckType ELB, instance refresh for deployments, minimum 3 for N+1 across 3 AZs
Step 2: Data Tier
- Aurora PostgreSQL cluster: writer + 2 readers in different AZs, encrypted with a multi-Region KMS key, backup retention 14 days, Performance Insights, deletion protection, parameter group with
rds.force_ssl=1, credentials in Secrets Manager with rotation - RDS Proxy for connection pooling from the app
- ElastiCache Redis Multi-AZ replication group for sessions and cache-aside
- S3 for assets with versioning, SSE-KMS, lifecycle, CRR with RTC to the DR Region, Block Public Access, CloudFront OAC
Step 3: Backups and Retention
bash
aws backup create-backup-plan --backup-plan '{"BackupPlanName":"webapp","Rules":[
{"RuleName":"daily","TargetBackupVaultName":"primary-vault","ScheduleExpression":"cron(0 18 * * ? *)","StartWindowMinutes":60,"CompletionWindowMinutes":240,
"Lifecycle":{"DeleteAfterDays":35},
"CopyActions":[{"DestinationBackupVaultArn":"arn:aws:backup:ap-southeast-1:111111111111:backup-vault:dr-vault","Lifecycle":{"DeleteAfterDays":35}}]},
{"RuleName":"monthly","TargetBackupVaultName":"primary-vault","ScheduleExpression":"cron(0 19 1 * ? *)","Lifecycle":{"MoveToColdStorageAfterDays":30,"DeleteAfterDays":365}}]}'
aws backup put-backup-vault-lock-configuration --backup-vault-name dr-vault --min-retention-days 7 --changeable-for-days 3
- Select resources by tag
backup=true. Enable restore testing monthly. Send failed-job events to SNS
Step 4: DR Region (Pilot Light)
- Deploy the same template in the DR Region with ASG min = 0 and the same launch template (AMI copied by Image Builder distribution)
- Add an Aurora Global Database secondary (replication lag usually under a second) and keep one small reader running
- Replicate secrets (Secrets Manager replica), Parameter Store values (via pipeline), ECR images, ACM certificate (request in DR Region), WAF ACL (same template)
- Create the Route 53 health check on the primary endpoint and failover records (primary alias to the primary ALB/CloudFront origin group, secondary to the DR ALB)
- Request quota increases in the DR Region for the vCPUs you will need during failover
Step 5: Monitoring and Alerts
| Alarm | Action |
|---|---|
ALB HTTPCode_Target_5XX_Count rate, TargetResponseTime p95 | Page on-call via SNS and Chatbot |
UnHealthyHostCount above 0 for 5 minutes | Notify, investigate |
ASG GroupInServiceInstances below 3 | Notify |
Aurora CPUUtilization, FreeableMemory, DatabaseConnections, AuroraGlobalDBReplicationLag | Notify, scale |
Redis EngineCPUUtilization, Evictions | Notify |
| Backup job failed / copy failed | Notify |
| Route 53 health check unhealthy | Page |
| Budget forecast above 100 percent | Email finance and engineering |
| GuardDuty severity 7 and above | Page security |
Step 6: Game Day
- AZ failure: use FIS to stop instances in one AZ (stop condition: 5xx alarm). Expect ASG to replace and no user-visible outage
- DB failure: fail over Aurora (
failover-db-cluster). Measure reconnect time - Cache failure: reboot the primary Redis node and watch fallback behavior
- Region failure: disable the primary health check target. Promote the Aurora secondary (
failover-global-cluster), scale the DR ASG, verify Route 53 switches. Record actual RTO and RPO - Restore test: restore the latest backup into a scratch environment and verify data
- Write findings and fix gaps
Operations Runbook (Table of Contents)
- Service overview, owners, contacts, escalation, severity definitions
- Dashboards, alarms and what each means
- Routine tasks: patching, certificate renewals, key rotation, quota reviews, cost review, backup restore tests
- Incident playbooks: high latency, 5xx spike, database failover, disk full, deployment rollback, compromised instance
- DR playbook: declare, promote, scale, switch DNS, validate, communicate, failback
- Change process: pipeline, approvals, freeze calendar, rollback
- Post-incident review template
Cost Estimate Approach
- Use the Pricing Calculator for primary (3 NAT gateways, ALB, 3+ instances, Aurora with 3 instances, ElastiCache, CloudFront, WAF), and the pilot light (one small DB replica, replicated storage, backup copies, global DB I/O)
- Tag everything by
project=webappandenv. Add a budget with forecast alerts. After a month compare actual vs estimate and right-size
Well-Architected Check
| Pillar | Evidence in this project |
|---|---|
| Operational excellence | IaC, runbooks, game days, alarms |
| Security | Private subnets, WAF, KMS, Secrets Manager, GuardDuty, least privilege |
| Reliability | Multi-AZ everywhere, backups, cross-Region DR, health checks |
| Performance efficiency | Target tracking, caching, RDS Proxy, CloudFront |
| Cost optimization | Right-sizing, Savings Plans on baseline, budgets, lifecycle rules |
| Sustainability | Graviton instances, scale-in, storage tiering |
Conclusion
The capstone ties the course together: a multi-AZ web tier and data tier, backups with cross-Region copies, a pilot-light DR Region with Route 53 failover, monitoring, game days that measure real RTO and RPO, and a runbook the team can follow at 3 a.m.
Quick Summary: requirements; architecture; network and compute; data; backups; DR; monitoring; game day; runbook; cost; well-architected.

