HeadlinesBriefing favicon HeadlinesBriefing.com

GCP Serverless Architecture Without the Bill Shock

DEV Community •
×

A developer building a Go-based geospatial SaaS on GCP faced two major hurdles: Terraform trying to recreate existing infrastructure and a $17/month VPC connector fee. By syncing state with terraform import and using PRIVATE_RANGES_ONLY, both issues were resolved.

Running Cloud Run with private Cloud SQL access usually requires a paid VPC connector. However, Google now supports direct VPC egress without extra cost. Configuring egress = PRIVATE_RANGES_ONLY in Terraform allowed secure internal routing while keeping external traffic unaffected.

The experience highlights common pitfalls of Infrastructure as Code when teams switch environments. Proper variable alignment and state import prevent dangerous drift. For startups or solo devs, avoiding unnecessary fixed costs like idle connectors can mean the difference between staying live and shutting down early.

Beyond infrastructure, the project also produced a dual-mode Node.js SDK using `tsup`, supporting both ES Modules and CommonJS. This kind of tooling self-development is increasingly important for API-first services looking to lower adoption friction.