Sub topic 7
Pilot light: a minimal always-on core
This chapter assumes you know RTO and RPO, cross-Region data replication, and the basics of Auto Scaling groups, launch templates, and Route 53.
What pilot light keeps running
Pilot light takes its name from a gas heater. A small flame stays lit so the whole burner can start quickly. In AWS terms, the data layer runs and replicates all the time in the DR Region. The compute layer exists as configuration but stays off or tiny.
| Layer | State in the DR Region |
|---|---|
| Database and storage | Running, continuously replicated |
| Application servers | Defined (AMIs, launch templates, Auto Scaling groups) but at zero or minimal size |
| Load balancer and networking | Usually pre-created |
| Traffic | Still sent to the primary Region |
Compared with backup and restore, you skip the slow step of restoring data. The data is already there. Compared with warm standby, you pay almost nothing for compute, but you must start it during a disaster. Typical recovery is tens of minutes, and RPO is seconds to minutes, depending on the replication lag.
Preparing the DR Region
Three things must exist before a disaster:
- Replicated data. Use a mechanism that matches your database, such as an Aurora global database, a DynamoDB global table, or S3 Cross-Region Replication.
- Deployable compute. Copy your AMIs to the DR Region, because an AMI ID is Region-specific. Define a launch template and an Auto Scaling group with a desired capacity of zero or a very small number.
- Infrastructure as code. Deploy the same templates (CloudFormation or Terraform) to both Regions, with parameters for Region-specific values. This keeps the dormant fleet from drifting away from production.
Also replicate or recreate secrets, KMS keys, and parameters in the DR Region. These are easy to forget.
Failing over
Failover has three parts: scale up compute, promote the data, and redirect traffic. The commands below do the first two.
# 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
# Planned switchover of an Aurora global database to the DR Region's cluster
aws rds failover-global-cluster \
--region us-west-2 \
--global-cluster-identifier app-global \
--target-db-cluster-identifier arn:aws:rds:us-west-2:111122223333:cluster:app-dr-clusterThe Aurora command, run as shown, expects a healthy primary. If the primary Region is unreachable, the same command needs the --allow-data-loss flag. It then promotes the secondary cluster, and writes not yet replicated are lost. That loss is your actual RPO, so decide ahead of time who can authorize it.
For the third part, a Route 53 failover record pair with a health check on the primary sends DNS answers to the DR load balancer. Use a low TTL, such as 60 seconds, so clients move quickly.
Common errors
- Stale AMIs. The DR launch template points to an old image, so the servers start with outdated code.
- Missing dependencies. Secrets, KMS keys, IAM roles, or security groups were never created in the DR Region.
- Manual steps. A runbook that depends on one person's memory slows recovery beyond your RTO.
- No rehearsal. The first scale-up should not happen during a real outage.
Exercise
A team runs a pilot light setup with an Aurora global database and a DR Auto Scaling group at size 0. During a drill, the group scales to 4 instances but they all fail health checks. Name two likely causes that come from missing DR Region preparation.
Show answer
Likely causes include an AMI or launch template that was not copied or updated in the DR Region, so the instances run old or incomplete software. Missing Region-specific dependencies are another cause, such as Secrets Manager secrets, KMS keys, or security group rules. The application cannot start, or cannot reach the database, without them. Deploying the same infrastructure as code to both Regions and rehearsing the failover would catch both problems.