Difference between revisions of "Terraform workspaces"
Jump to navigation
Jump to search
(17 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | Terraform workspaces (Mar 2017, previously known as State Environments ) allows to have multiple [[state files]] in the same working directory to manage multiple distinct sets of infrastructure resources. | ||
* https://www.terraform.io/language/state/workspaces | * https://www.terraform.io/language/state/workspaces | ||
Line 6: | Line 7: | ||
* <code>[[terraform.tfstate.d]]</code> | * <code>[[terraform.tfstate.d]]</code> | ||
− | * [[VCS]] | + | * [[VCS connections]] https://www.terraform.io/cloud-docs/workspaces/settings/vcs |
* <code>[[terraform workspace -help]]</code> | * <code>[[terraform workspace -help]]</code> | ||
+ | |||
+ | * Supported [[backends]]: [[AzureRM]], Consul, COS, etcdv3, GCS, Kubernetes, [[Local]], Manta, [[OSS]], Postgres, Remote, [[S3]], Swift | ||
+ | |||
+ | == 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 TOC}} | ||
+ | |||
+ | == Related == | ||
+ | * <code>${[[terraform.workspace]]}</code> | ||
+ | * [[Terraform provider: dns]] | ||
+ | * [[Terragrunt]] | ||
== See also == | == See also == |
Latest revision as of 19:03, 15 July 2024
Terraform workspaces (Mar 2017, previously known as State Environments ) 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[edit]
- 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[edit]
terraform workspace new MY_NEW_WORKSPACE
terraform workspace select
terraform workspace list
terraform workspace show
terraform workspace delete
terraform workspace --help
Related[edit]
See also[edit]
Advertising: