DEV Community

Deplyra
Deplyra

Posted on

A Terraform Repo Structure That Scales From 1 to 50 Engineers

Most Terraform pain isn't the language — it's the layout. This is the repo structure we use for client projects: how to split modules from live environments, when to use workspaces (almost never), and how to keep plan output small enough to actually review.

  1. The two failure modes: one giant root module vs 400 micro-repos
  2. The layout: modules/ (reusable) + envs/dev|staging|prod (thin roots)
  3. State isolation per environment — blast-radius thinking
  4. Versioning modules with git tags
  5. CI wiring: plan on PR, apply on merge, manual gate for prod
  6. What we deliberately don't do (workspaces for envs, monorepo-wide applies)

Top comments (0)