feat(gcp): add native managed data bootstrap
Merged
KH
12d ago+989+989+012345678901234567890123456789-27-27-01234567890123456789
Summary
- make the GCP existing-cluster example provision the native Sessions data path: TLS-only Standard HA Memorystore, Pub/Sub pull queue and DLQ, exact Workload Identity IAM, and the relaycontrol/relaycast/hoopdb database set
- add shared-CA Cloud SQL DNS with a private DNS mapping so every PostgreSQL URL uses
sslmode=verify-full - add an idempotent
cloud-sql-setup.sh pre|postfor databases, owners, runtime roles, extensions, CA delivery, credential files and post-migration login activation
Validation
terraform -chdir=terraform/examples/gcp validate- example mock apply: 1 passed
- postgres module tests: 8 passed
- TFLint and terraform-docs checks for both changed roots
bash -nand ShellCheck for the setup scriptscripts/selfhost/tests/run-tests.sh(all passed)
Live GKE apply/e2e is tracked separately and awaits refreshed noninteractive gcloud credentials.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Adds the native Sessions data path to the GCP example: TLS-only HA Memorystore, a Pub/Sub pull queue with DLQ, and exact Workload Identity IAM. chart_values is now a complete overlay for values-gcp-native.yaml, also covering the read API, ingest edge, and search indexer; Cloud SQL uses a shared CA with private DNS, and the postgres module preserves the verified FQDN byte-for-byte (terminal dot included) so application URLs use sslmode=verify-full.
- The
cloud-sql-setup.sh pre|postprovisions databases, roles, extensions, and credentials idempotently, bootstrapping the session consumer role before the migration Job runs; SQL runs in short-lived hardened Jobs inside GKE. Thepoststep resolves the current HoopDb migrate Job from the Helm manifest and activates logins only once that exact Job has completed and none has failed. - Adds the
relaycastdatabase while retainingrelayhistoryso legacy installs are never destructively updated;relaycaststays owned by the Cloud SQL admin to satisfy the production owner-boundary check, and Workload Identity principals match the native pipeline service accounts. - Defaults
deletion_protectionto true for Cloud SQL, Memorystore, and Pub/Sub; set false for disposable proof environments. - Adds offline test suites for the setup script and native Terraform assertions.