Feature request: support terraform workspaces
Description
Terraform supports the concept of workspaces where a single set of templates can manage multiple "stacks" of resources separately using the same state backend. Currently, to-be-continuous/terraform does not inherently support the use of terraform workspaces.
Possible workarounds:
- override
.tf-baseand insert your own workspace selection commands in thebefore_script. This is not ideal because it could break something if you upgrade to a future release of to-be-continuous/terraform - roll your own workspace selection using pre-plan/pre-apply hooks. This is less than ideal - workspace selection should happen immediately after the init, but to-be-continuous/terraform does not currently support post-init hooks. Also it violates DRY principles because you have to implement the same logic in two different places.
Implementation ideas
Introduce a TF_WORKSPACE variable. When TF_WORKSPACE is set to a non-empty/non-default value, the chosen workspace should be selected after init.