🌍Terraform

  • Layer 3. All Terraform root modules live under terraform/; each is standalone. Applies run through Atlantis on the PR β€” never locally (ADR/0001 GitOps apply model).

  • Network fabric β€” terraform/network/

    • unifi/folly/ β€” primary-site UniFi: VLANs, BGP config, client management (state prefix terraform/unifi)

    • unifi/offsite/ β€” offsite UniFi: networks, WANs, WLANs, BGP (state prefix terraform/unifi/offsite)

    • cloudflare/ β€” DNS zones (pulsifer.ca, wishin.app, lolwtf.ca), tunnels, security rules, the Pages project behind this wiki

    • tailscale/ β€” devices, routes, ACL policy

  • Cloud & identity

    • gcp/organization/ β€” org-level IAM, folders, projects, billing

    • gcp/projects/<name>/ β€” per-project resources (homelab-ng, firebees, lolcorp, …)

    • argo/ β€” ArgoCD application definitions

    • google-workspace/ β€” users, groups, domains

    • vault/ β€” Vault auth, mounts, policies

    • modules/ β€” reusable modules consumed by relative path

  • Workflow

    • Open a PR β†’ Atlantis autoplans the changed module(s) β†’ review the plan β†’ comment atlantis apply β†’ successful apply automerges.

    • Locally, only inspection:

    • terraform init -backend=false && terraform validate
      terraform fmt -recursive
    • Never terraform apply against remote state β€” it races Atlantis and causes lock contention and drift.

    • Roots that need network facts read the SSOT: jsondecode(file(".../cluster-topology.json")).data via a topology.tf per root (ADR/0003 Cluster topology single source of truth).

  • CI

    • terraform.yml validates changed .tf files on PRs, then auto-formats and regenerates terraform-docs on merge to main. trivy.yml scans for IaC vulnerabilities. Renovate bumps providers.

Linked references 5

Home

Layer 3 β€” Cloud & network: UniFi, Cloudflare, Tailscale, GCP, and Vault, all under Architecture/Terraform with applies gated through Atlantis.

Runbooks/Terraform Change

Use this when changing Terraform under terraform/ or cluster bootstrap Terraform under clusters/<site>/bootstrap/. Background lives in Architecture/Terraform and the apply model is ADR/0001 GitOps apply model.

Architecture

Layer 3 β€” Cloud & network (Architecture/Terraform)