Difference between revisions of "Terraform workspaces"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
* https://www.terraform.io/language/state/workspaces | * https://www.terraform.io/language/state/workspaces | ||
+ | * <code>[[terraform workspace]]</code> | ||
Certain [[backends]] support multiple named workspaces allowing multiple states to be associated with a single configuration. | Certain [[backends]] support multiple named workspaces allowing multiple states to be associated with a single configuration. |
Revision as of 09:05, 14 October 2022
Terraform workspaces allows to have multiple state files in the same working directory to manage multiple distinct sets of infrastructure resources.
Certain backends support multiple named workspaces allowing multiple states to be associated with a single configuration.
- Supported backends: AzureRM, Consul, COS, etcdv3, GCS, Kubernetes, Local, Manta, OSS, Postgres, Remote, S3, Swift
Contents
Usage scenarios
- To create a parallel, distinct copy of a set of infrastructure in order to test a set of changes before modifying the main production infrastructure.
- Non-default workspaces are often related to feature branches in version control.
Commands
terraform workspace new MY_NEW_WORKSPACE
terraform workspace select
terraform workspace list
terraform workspace show
terraform workspace delete
terraform workspace --help
Related
${terraform.workspace}
- Terraform provider: dns
See also
Advertising: