HOWTO: Provision a Cloud SQL Standby for PostgreSQL DR¶
Purpose: Provision a Cloud SQL PostgreSQL instance as a managed DR standby, configure the replication feed, and validate it against the DR decision service.
Difficulty: Advanced
Track: Disaster Recovery Automation
Overview¶
Cloud SQL in HybridOps is not a general database service: it is a specific DR lane with defined RTO/RPO targets, a wired health signal, and a tested failover path. This HOWTO covers provisioning the standby instance and confirming it is ready to receive a failover decision.
1. Architecture Position¶
- On-prem primary → Cloud SQL logical replica topology.
- Cloud SQL DR lane vs self-managed pgBackRest lane.
- RTO/RPO targets for the Cloud SQL path.
2. Module Overview¶
- Module ID:
gcp/cloudsql-dr-standby. - GCP project, region, and instance tier inputs.
- Terraform provider configuration.
3. Provisioning the Cloud SQL Instance¶
- Module input map: instance spec, database version, network configuration.
- VPC peering or Private Service Connect for on-prem connectivity.
- Module execution and run record review.
4. Configuring Logical Replication¶
- Publication on the on-prem primary.
- Subscription on Cloud SQL.
- Replication lag monitoring.
5. Health Signal Wiring¶
- Cloud SQL health check endpoint registration in the DR decision service.
- Replication lag signal threshold configuration.
- Test signal emission and decision service response.
6. Pre-Drill Validation¶
- Replication lag below RPO threshold.
- Application credentials provisioned on Cloud SQL.
- DNS failover entry pre-configured.
References¶
- ADR-0501 – PostgreSQL on Dedicated VM with DR Replication
- HOWTO: Configure the DR Decision Service
- HOWTO: Validate DNS Cutover
License: MIT-0 for code, CC-BY-4.0 for documentation unless otherwise stated.