Projects & Workspace

Projects are collections of related workspaces and, workspaces are logical environments that allow you to organize and manage your infrastructure code

Projects

Projects let you organize your workspaces and scope access to workspace resources. Each project has a separate permissions set that you can use to grant teams access to all workspaces in the project. Project-level permissions are more granular than organization-level permissions, but more specific than individual workspace-level grants.

Workspaces

When run locally, Terraform manages each collection of infrastructure with a persistent working directory, which contains a configuration, state data, and variables. Since Terraform CLI uses content from the directory it runs in, you can organize infrastructure resources into meaningful groups by keeping their configurations in separate directories.

Terraform Cloud manages infrastructure collections with workspaces instead of directories. A workspace contains everything Terraform needs to manage a given collection of infrastructure, and separate workspaces function like completely separate working directories.

It’s always a good idea to adhere to least priviledge access methods and limit access to cloud platform landing zones based on limiting what the service principal you use in Terraform cloud has access to. So in Azure you could think of linking a workspace with a subscripton.

Every workspace must belong to exactly one project.

Workspace contents

ComponentTerraform localTerraform Cloud
ConfigurationDiskVCS
VariablesTFVARSWorkspace
StateDisk or remoteWorkspace
Credentials/secretsLocal environmentWorkspace

References

Workspaces

Last modified July 21, 2024: update (e2ae86c)