🚀 Enhancements
Allow overriding terraform workspace per component using `metadata.terraform_workspace` attribute @aknysh (#104)
what
- Allow overriding terraform workspace per component using
metadata.terraform_workspace
attribute
why
- For backwards compatibility with the old
atmos
versions and some existing stack configs where Terraform workspace was generated by using the names of the stack files (instead of being generated from thecontext
asatmos
1.x.x
does) - By explicitly setting the old/existing TF workspace, terraform will not try to recreate those components
test
atmos describe component test/test-component-override-3 -s=tenant1-ue2-dev
component: test/test-component
inheritance:
- mixin/test-2
- mixin/test-1
- test/test-component-override-2
- test/test-component-override
- test/test-component
metadata:
component: test/test-component
inherits:
- test/test-component-override
- test/test-component-override-2
- mixin/test-1
- mixin/test-2
terraform_workspace: test-component-override-3-workspace
atmos terraform plan test/test-component-override-3 -s=tenant1-ue2-dev
Command info:
Terraform binary: terraform
Terraform command: plan
Arguments and flags: []
Component: test/test-component-override-3
Terraform component: test/test-component
Inheritance: test/test-component-override-3 -> mixin/test-2 -> mixin/test-1 -> test/test-component-override-2 -> test/test-component-override -> test/test-component
Stack: tenant1/ue2/dev
Working dir: examples/complete/components/terraform/test/test-component
Executing command:
/usr/local/bin/terraform workspace select test-component-override-3-workspace
Workspace "test-component-override-3-workspace" doesn't exist.
You can create this workspace with the "new" subcommand.
Executing command:
/usr/local/bin/terraform workspace new test-component-override-3-workspace
Created and switched to workspace "test-component-override-3-workspace"!
You're now on a new, empty workspace. Workspaces isolate their state,
so if you run "terraform plan" Terraform will not see any existing state
for this configuration.