Cloud / IaC · Earlier generation
The GCP Project Factory: Folder, Project, VPC and GKE per Tenant
An earlier-generation Terraform estate that onboards a team or customer on GCP with a folder, main and sub-projects, private networking, data services and GKE.
// Overview
Team and customer roots (lower and upper) share one shape: a folder module, a project factory (main plus secondary projects), VPC with optional shared-VPC attachment, firewall rules, private service access, buckets, messaging, analytics, private PostgreSQL and one or two clusters. After the primary cluster a dispatch triggers a policy-controller workflow. Companion roots handle autoscaling, service mesh and DNS.
// The problem
Consistent, private-by-default tenant projects, driven from a key-value store and a size class that sets node counts.
// Flow
- Config readtenant values read from Vault
- Folder and projectsfolder, main project and secondary projects from factory modules
- Networktenant VPC, optional shared-VPC host attachment, private service access
- Data servicesbuckets, topics, dataset, private-IP-only PostgreSQL
- Computeprivate-node GKE clusters with workload identity, sized by class
- Gate: policy dispatch gateadmission-control workflow triggered for the new cluster
- Follow-on rootsautoscaling, service mesh for HA, DNS records from Vault-held lists
// Design decisions & guardrails
- Internal IPs only; external IPs disabled across services.
- A dedicated provisioning identity holds org-level roles, granted by a separate group script.
- Secondary projects use cross-project IAM bindings rather than copied credentials.
- DNS records derive from a Vault list with filtering of incomplete entries.
- An HA flag decides whether the second cluster, mesh and autoscaling modules exist.
// Outcome
Two project types per folder and a repeatable tenant shape across lower and upper.