08. Workspaces
Contents
See: Workspaces
Workspaces allow multiple state files of a single configuration. Most of the time, each workspace has a different set of environment variables associated.
Not suitable for isolation for strong separation between workspace (stage/prod)
→ One codebase, several environments (dev1, dev2,...)
→ State File Directory: terraform.tfstate.d/dev1, terraform.tfstate.d/dev2,...
Commands
- terraform workspace new Create a new workspace
- terraform workspace list List Workspaces
- terraform workspace select Select a workspace
- terraform workspace show Show the name of the current workspace
- terraform workspace delete Delete a workspace. The default workspace can NOT be deleted.
→ Variable ${terraform.workspace}