HyOps Cloud SQL External Replica Lifecycle¶
Purpose¶
org/gcp/cloudsql-external-replica is the live managed PostgreSQL DR module for the GCP lane.
It currently supports two operator phases:
assessestablish
assess validates upstream source posture and an existing Cloud SQL target.
establish creates Database Migration Service objects:
- source PostgreSQL connection profile
- destination Cloud SQL connection profile
- migration job
Important:
- the DMS
establishpath creates its own Cloud SQL replica - it does not reuse a standalone
org/gcp/cloudsql-postgresqlinstance
Prerequisites¶
hyops init gcpcompleted for the selected environmentplatform/onprem/postgresql-dr-sourcestate isok- for
assess,org/gcp/cloudsql-postgresqlstate isok - the operator has working
gcloudauthentication on the control host
Validate¶
cd /home/user/hybridops-studio/hybridops-core
./.venv/bin/hyops validate --env dev --skip-preflight \
--module org/gcp/cloudsql-external-replica \
--inputs modules/org/gcp/cloudsql-external-replica/examples/inputs.min.yml
Apply¶
cd /home/user/hybridops-studio/hybridops-core
./.venv/bin/hyops apply --env dev \
--module org/gcp/cloudsql-external-replica \
--inputs modules/org/gcp/cloudsql-external-replica/examples/inputs.min.yml
Establish¶
Prepare an operator input file with at least:
apply_mode: establishproject_state_reforproject_idnetwork_state_reforprivate_networksource_connection_profile_namedestination_connection_profile_namemigration_job_namesource_replication_usersource_replication_password_envconnectivity_mode
Then run:
cd /home/user/hybridops-studio/hybridops-core
./.venv/bin/hyops apply --env dev \
--module org/gcp/cloudsql-external-replica \
--inputs <operator-establish-inputs.yml>
Expected outputs¶
cap.db.managed_external_replica = assessed|establishedmanaged_replication_mode = logicalmanaged_replication_prereqs_ready = true|falsemanaged_replication_established = true|false- target instance metadata and target private IP
- source leader and source replication candidate signal
Notes¶
- The module copies the operator's existing
~/.config/gcloudinto the HyOps runtime cache on first use so packaged runs do not rely on write access to the default gcloud config directory. - The module keeps replication secrets out of Terraform state by using
gcloudon the controller side. static-ipconnectivity requires the source database to accept DMS traffic from an allowlisted public IP.reverse-sshconnectivity requires an explicit bastion VM and VPC input.