Add metadata.terraform_workspace_pattern
#138
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what
metadata.terraform_workspace_pattern
why
metadata.terraform_workspace
using which we can specify/override the terraform workspace for a componentmetadata.terraform_workspace_pattern
introduces a pattern to override a terraform workspace for a componentThe following tokens are supported in
metadata.terraform_workspace_pattern
: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