How reticent93/pilot_light_dr_recovery works
This repository is Terraform infrastructure for AWS pilot-light disaster recovery across primary and secondary regions. The documented workflow monitors primary load-balancer health, triggers failover automation, scales the secondary Auto Scaling Group, and notifies administrators; traffic is switched by moving an Elastic IP, with DNS updates described as a manual recovery option. The graph also preserves the documented cross-region data, networking, security, and monitoring capabilities. Source excerpts show the Lambda’s ASG, instance-polling, EIP, and SNS actions; other module relationships rely on README descriptions, not inspected Terraform wiring.
Main entry points: primary/main.tf Primary environment · secondary/main.tf Secondary environment · failover.py Failover Lambda · asg/main.tf Auto Scaling
Components 20
Regional deployment
- Global environment
environments/global/main.tf - Primary environment
environments/primary/main.tf - Secondary environment
environments/secondary/main.tf
Application infrastructure
- VPC networking
modules/vpc/main.tf - Load balancer
modules/load-balancer/main.tf - Auto Scaling
modules/asg/main.tf
Failover and monitoring
- Health monitoring
modules/monitoring/main.tf - DNS failover
modules/dns-failover/main.tf - Failover Lambda
modules/automation/lambda/failover.py - Automation setup
modules/automation/main.tf - SNS notifications
modules/notifications/main.tf
Replicated data and security
- DynamoDB global tables
modules/dynamodb/main.tf - S3 replication
modules/storage/S3/main.tf - IAM permissions
modules/iam/main.tf - Security groups
modules/security-groups/main.tf
Other components
- Administrators
- CloudWatch alarms
- EventBridge rule
- Amazon SNS
- Elastic IP
Connections 22
- Administrators → Global environment: deploys
README.md - Administrators → Primary environment: deploys
README.md - Administrators → Secondary environment: deploys
README.md - Primary environment → Load balancer: provisions
README.md - Primary environment → Auto Scaling: provisions
README.md - Secondary environment → Auto Scaling: provisions
README.md - Health monitoring → Load balancer: checks health
README.md - CloudWatch alarms → EventBridge rule: triggers
README.md - EventBridge rule → Failover Lambda: invokes
README.md - Failover Lambda → Auto Scaling: scales
modules/automation/lambda/failover.py - Failover Lambda → Elastic IP: associates
modules/automation/lambda/failover.py - Failover Lambda → Amazon SNS: publishes
modules/automation/lambda/failover.py - Amazon SNS → Administrators: alerts
README.md - Administrators → DNS failover: updates manually
README.md - Primary environment → VPC networking: configures
README.md - Secondary environment → VPC networking: configures
README.md - Primary environment → DynamoDB global tables: deploys
README.md - Secondary environment → DynamoDB global tables: deploys
README.md - Primary environment → S3 replication: deploys
README.md - Secondary environment → S3 replication: deploys
README.md - Primary environment → IAM permissions: configures
README.md - Primary environment → Security groups: configures
README.md