fix(infra): remove VPC peering complexity for Cloud SQL access #127
+336
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR simplifies Cloud SQL networking for preview environments by removing the complex bidirectional VPC peering approach from #126.
The Problem:
The original PR required manually maintaining
preview_vpc_namesvariable and redeploying dev whenever a preview environment was created. VPC peering requires both sides to create peering resources, which created an operational burden.The Solution:
Each VPC (dev, preview, prod) already creates a
google_service_networking_connectionto Google's servicenetworking VPC. Since Cloud SQL sits in the servicenetworking VPC, any environment with this connection can already reach Cloud SQL directly - no VPC-to-VPC peering needed.Changes
preview_vpc_namesvariable and all VPC peering resources fromvpc.tfdatabase_private_ip,database_connection_name, etc.) tooutputs.tfdev_database_private_ipanddev_database_connection_namevariables for preview environmentsdeploy.ymlto fetch dev database info before planning preview environmentsHow it works