Terraform infrastructure for the one-access platform. One Makefile surface, three provider backends: GCP (GKE + GAR), AWS (EKS + ECR), Local (Minikube + Docker registry).
┌────────────────┐ ┌────────────────┐ ┌────────────────────┐
│ infra-setup │──cluster─▶│ infra-ops │──deploys─▶│ app layer │
│ (Terraform) │ registry │ (Helm / K8s) │ │ one-auth / *-ui │
│ ◀── you are │ DNS │ │ │ │
│ here │ │ │ │ │
└────────────────┘ └────────────────┘ └────────────────────┘
Produces the cluster, registry, DNS zone, and Workload Identity Federation that every downstream repo assumes.
- Stands up a Kubernetes cluster + container registry + DNS on GCP, AWS, or local Minikube.
- Wires GitHub Actions to the cloud via Workload Identity Federation — no long-lived cloud keys.
- Exposes one Makefile (
setup,setup-post,integrate-domain,verify,destroy) that delegates to the selected provider.
infra-setup/
├── Makefile # dispatches to <provider>/Makefile
├── gcp/ # google_container_cluster (Autopilot), GAR, DNS, WIF, LB
│ ├── main.tf # cluster + artifact registry + billing budget
│ ├── dns.tf # managed zone + root/www/wildcard records
│ ├── identity-federation.tf # GitHub WIF pool + service account
│ ├── load-balancer.tf # global compute address for ingress
│ └── outputs.tf # values consumed by infra-ops + CI
├── aws/ # EKS, ECR, VPC, ALB-SG, Route53, OIDC IdP
│ ├── main.tf # cluster + node group + ECR
│ ├── networking.tf # VPC, subnets, IGW, routes
│ ├── iam.tf # EKS cluster + node roles
│ ├── identity-federation.tf # GitHub OIDC + IAM role
│ ├── route53.tf # zone
│ └── load-balancer.tf # ALB security group
├── local/ # Minikube + docker registry (no terraform state)
│ └── Makefile # minikube start / registry / hosts / tunnel
├── environments/
│ ├── dev.tfvars
│ └── prod.tfvars # cloud_provider, project_id, domain, WIF pool IDs
└── TERRAFORM-GUIDE.md # deep dive on state, modules, cost
State is isolated per provider (terraform-gcp.tfstate, terraform-aws.tfstate). Local has no terraform state — it's pure Makefile over Minikube.
| Resource | GCP | AWS | Local |
|---|---|---|---|
| Cluster | GKE Autopilot | EKS (2× t3.medium) | Minikube (4 CPU / 8 GB) |
| Container registry | Artifact Registry | ECR | Docker registry on :5000 |
| DNS | Cloud DNS zone + records | Route53 zone | /etc/hosts entries |
| Load balancer / ingress IP | Global compute address | ALB security group | minikube tunnel |
| GitHub → cloud identity | WIF pool + provider + SA | OIDC IdP + IAM role | n/a |
| Networking | (managed by Autopilot) | VPC + subnets + IGW + routes | (Minikube network) |
| Cost guard | Billing budget alert | — | — |
- Provider-delegated Makefile. Root
Makefiledoes no terraform directly; it dispatchesmake <target> PROVIDER=<p>into<p>/Makefile. Adding a fourth provider is a new directory, not a refactor of the root surface. - Workload Identity Federation replaces cloud keys. GitHub Actions authenticates to GCP/AWS via short-lived OIDC tokens exchanged through the federation. No
GCP_SA_KEYorAWS_ACCESS_KEY_IDsecrets in GitHub. - Versioned WIF pool IDs. GCP soft-deletes WIF pools for ~30 days.
prod.tfvarspinsworkload_identity_pool_id = "github-actions-v3"— bump the suffix to re-create cleanly. - Env-scoped tfvars, not workspaces.
dev.tfvars/prod.tfvarscarry the provider-agnostic configuration (project, domain, budget).ENV=dev|prodselects the file; state stays flat. - Domain is optional, late-binding.
domain_namecan be empty atsetuptime;make integrate-domain PROVIDER=<p>wires DNS later without re-provisioning the cluster.
# One provider, end to end
make setup PROVIDER=local # 1. provision
make setup-post PROVIDER=local # 2. kubeconfig + registry login
make verify PROVIDER=local # 3. smoke-check
# Cloud (dev env)
make setup PROVIDER=gcp ENV=dev
make setup-post PROVIDER=gcp ENV=dev
make integrate-domain PROVIDER=gcp ENV=dev # optional: attach domain later
# Tear down
make destroy PROVIDER=gcp ENV=devDrop into a provider directory for fine-grained targets: cd gcp && make help.
Edit environments/<env>.tfvars:
| Variable | Purpose |
|---|---|
cloud_provider |
gcp or aws |
project_id |
GCP project / AWS account identifier |
region |
Target region |
environment |
dev / prod |
app_name |
Namespace / resource prefix |
domain_name |
Optional; empty skips DNS |
github_organization |
Org allowed through WIF |
workload_identity_pool_id |
Bump suffix to re-create after GCP soft-delete |
billing_account_id |
GCP-only; required for budget alerts |
- Deep dive on modules, state, cost: TERRAFORM-GUIDE.md
- Downstream consumer: ../infra-ops/
- Sibling repos: ../README.md