v1.4.8
what
- Add
metadata.terraform_workspace_pattern
why
- We already have
metadata.terraform_workspace
using which we can specify/override the terraform workspace for a component metadata.terraform_workspace_pattern
introduces a pattern to override a terraform workspace for a component
metadata:
# Override Terraform workspace
terraform_workspace: xxxxxxxxxxxxxxx
terraform_workspace_pattern: "{tenant}-{environment}-{stage}-{component}"
-
The following tokens are supported in
metadata.terraform_workspace_pattern
:- {namespace}
- {tenant}
- {environment}
- {stage}
- {component}
- {base-component}
-
This is useful to when converting YAML stack configs from the old
atmos
based onvariant
. In he oldatmos
, when acomponent: xxx
attribute was specified for a component, it was considered as base component even if it was the same as the YAML component itself, in which case the terraform workspace for the component was calculated as<environment>-<stage>-<component>
. The newatmos
does not consider the same name for thecomponent:
attribute as a base component, which leads to the terraform workspace<environment>-<stage>
(and hence Terraform not seeing the old workspace and wanting to re-create the component. To fix it, addterraform_workspace_pattern: "{environment}-{stage}-{component}"
to the component's metadata