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.

  • Terraform
  • GKE
  • Shared VPC
  • Pub/Sub
  • BigQuery
  • Cloud SQL
  • Anthos Service Mesh
  • OPA Gatekeeper
  • Vault
  • Cloudflare

// 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

The GCP Project Factory: Folder, Project, VPC and GKE per Tenant flow1. Config read → 2. Folder and projects → 3. Network → 4. Data services → 5. Compute → 6. Gate: policy dispatch → 7. Follow-on roots01Config read02Folder and projects03Network04Data services05Compute06 · GATEGate: policy dispatch07Follow-on roots
  1. Config readtenant values read from Vault
  2. Folder and projectsfolder, main project and secondary projects from factory modules
  3. Networktenant VPC, optional shared-VPC host attachment, private service access
  4. Data servicesbuckets, topics, dataset, private-IP-only PostgreSQL
  5. Computeprivate-node GKE clusters with workload identity, sized by class
  6. Gate: policy dispatch gateadmission-control workflow triggered for the new cluster
  7. 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.

// Related