Interview Prep/Terraform/Repository Structure, Environments and Module Strategy

How do you provision per-customer or per-tenant environments?

IntermediateProductionRepository Structure, Environments and Module Strategy
Answer

Model each tenant as data and instantiate a tenant module with for_each, or one state per tenant created by a pipeline from a template. Per-tenant states limit blast radius and allow custom upgrades; one state with for_each is simpler but plan time grows and every tenant is touched at once. Choose based on tenant count and isolation needs.

All Terraform questions Roadmap: Terraform in production

More on Repository Structure, Environments and Module Strategy