A platform team moving a large estate to HCP Terraform expects about sixty workspaces across three projects: where do you draw those boundaries, and which team roles do you grant?
answer
- workspace for blast radius, project for access
- what changes together, who owns it
- one queue and one state per workspace
- permissions only ever add up
- the Read role is not harmless
basics
~20 sDraw workspaces around blast radius, rate of change and team ownership; draw projects around who needs which access. Grant roles at project level, keep project admins few, and remember permissions are additive: a narrower workspace role cannot subtract.
solid answer
~50 sI treat the two boundaries as different questions. A workspace is one state file and one run queue, so I split by blast radius, volatility, stateful against stateless, and team ownership, accepting the cost of sharing outputs between workspaces. A project is an access boundary: its permissions and variable sets apply to all current and future workspaces in it, so I group by who needs distinct access, for example production separate from development. Teams get project roles by default, with few project admins, and engineers proposing production changes get Plan, not Write. Permissions are additive, so a workspace role cannot remove what a project granted. The Read role can read complete state, so outputs-only needs a custom role. I would review the split when runs get long or people need access beyond their own area.
go deeper
Recall that projects group workspaces and carry permissions, and that every workspace belongs to exactly one project. Know the four fixed workspace roles in order: Read, Plan, Write, Admin.
Explain what each role can do, especially that Plan can queue but not apply. Explain why project-level variable sets and permissions reach future workspaces without further setup.
Reason from additive permissions: exceptions cannot be carved downward, so grants start narrow. Point out that Read exposes state, and that connected repositories can queue plans whatever a person's role is.
State the forces and pick: blast radius and ownership against the cost of wiring workspaces together. Say what you would review, which signals would change your mind, and who owns the standing structure.
## Two different boundaries This is a judgment call with no single right layout. In HCP Terraform, a **workspace** manages one state file and has one run queue. A **project** groups workspaces and carries permissions and variable sets. Keeping those purposes apart is most of the answer, because they get conflated into one debate about folders. ## Where to draw workspace boundaries The documentation's guidance, which I would treat as a starting point: - **Blast radius:** any operation can affect other resources in the same state file, so group only logically related resources. - **Volatility:** networks and databases change rarely, compute often. Grouping them exposes long-lived infrastructure to more chances of accidental change. - **Stateful against stateless:** separating databases from compute limits the damage of an operation that recreates resources. - **Team and privilege:** if a workspace's scope is too large, a user may need more permission than is appropriate to operate on it. The forces pull both ways, and that is the decision: | | Fewer, larger workspaces | More, smaller workspaces | |---|---|---| | Run queue | One queue shared by more people | Independent queues, parallel teams | | Plan size | Long runs, larger dependency graphs | Short runs | | Permissions | Broader grants needed | Grants fit ownership | | Cross-workspace wiring | Little | Outputs and state sharing to manage | | Changes spanning components | One run | Several runs in the right order | Long-running workloads are, in the documentation's words, an early sign of a bloated workspace scope. On the other side, a deployment that needs a practitioner to visit many projects is a sign you may have gone too far. For names, the suggested convention `<business-unit>-<app-name>-<layer>-<env>` makes the ownership readable. ## Where to draw project boundaries Ask which groups of resources need **distinct access rules**. Business units, departments and technical teams are all documented options, and for smaller organizations one project per cloud account can make access easier to manage. The documentation's own example is keeping a production networking workspace in a separate project from a development compute workspace. For the sixty workspaces here, one plausible cut is `platform-shared`, `apps-prod` and `apps-nonprod`, because production access is the distinction that matters most. A team structured around business units would reasonably cut differently. Project-level variable sets and permissions then apply to future workspaces too, so new ones start correct. The documentation also suggests a **landing zone project** holding what creates all the others, with the organization token in a variable set, automated through the `tfe` provider. That would be a small fourth project. ## Which roles to grant | Scope | Role | What it adds | |---|---|---| | Workspace | Read | Read runs, variables and complete state | | Workspace | Plan | Queue plans, which someone else must approve | | Workspace | Write | Apply runs, write variables and state, lock and unlock | | Workspace | Admin | Settings, team access, delete | | Project | Write | Write access on all its workspaces | | Project | Maintain | Admin on all its workspaces, plus create | | Project | Admin | Also project settings, team access, moving workspaces | Four rules shape how to use these: 1. **Permissions are additive.** A team's effective permissions are the sum across organization, project and workspace. Granting Read on one workspace does not reduce Write inherited from its project, so never plan to carve exceptions downward. 2. **Read includes state.** The fixed Read role can read complete state files, which often contain sensitive information. Someone who needs only outputs needs a custom role. 3. **Plan is the review role.** A Plan-only user's plans need approval, and running `terraform apply` from the CLI fails with `Insufficient rights to apply changes`. 4. **Grants have side doors.** Anyone who can merge to a connected repository's branch can indirectly queue plans there, whatever their role. Which features apply depends on the plan, so check team and project permissions against yours. ## Decisions to write down - Who may create workspaces, since new ones land in the Default Project unless a project is chosen. - Remote state sharing as least privilege. New workspaces share with nobody until someone opts in, and project-wide sharing is one setting away. - The default execution mode per project, and who may override it.
- What would push you to self-hosted Terraform Enterprise rather than HCP Terraform?Mostly who operates the service and where it must sit. With Terraform Enterprise you run the installation and size it: concurrency is configurable, defaulting to 10, and memory needs grow with it, and administrators can cap workspaces per organization. Check workflow gaps too: its docs say saved plan runs are not yet supported, and it ignores `terraform.tfvars`.
- How do you create sixty workspaces and their access without clicking through the UI?Manage them with Terraform through the `tfe` provider, including `tfe_team_access`. The documentation recommends a landing zone project holding what creates other projects, teams and workspaces, with a variable set containing the organization token for the provider, and a Sentinel policy keeping other projects away from that token.
- What does moving a workspace to another project change?It can change the workspace's read and write permissions and which users can reach it, because project grants apply to everything inside. It takes the Manage all Projects organization permission or explicit team admin on both projects. Project-scoped variable sets stop or start applying too, so review them before a move.
- How would you know the split is wrong a year later?Look for symptoms rather than counts. Long-running workloads suggest a bloated workspace. Teams given broader roles just to do their job suggest a boundary that misses ownership. Long waits behind other teams' runs suggest a shared queue. Practitioners touring several projects for one deployment, or heavy output sharing, suggest over-splitting.
- A bigger workspace has no cost, because HCP Terraform handles large plans for you.
- Set a workspace's role to Read to take away what its project granted a team.
- The Read role is harmless because it cannot see any state.
- Projects exist for tidy navigation and have no effect on permissions.
- New workspaces can read each other's state by default.
- Granting only the Plan role stops anyone changing production, whatever is connected to the workspace.