Miguel Zablah
12/04/2025, 6:22 PMAndriy Knysh (Cloud Posse)
12/04/2025, 6:26 PMAndriy Knysh (Cloud Posse)
12/04/2025, 6:27 PMorgs folder, you would have:
orgs:
acme1
.....
acme2
....Andriy Knysh (Cloud Posse)
12/04/2025, 6:28 PMatmos.yaml, you use this stack name template:Andriy Knysh (Cloud Posse)
12/04/2025, 6:29 PMname_template: "{{ .vars.namespace }}-{{ .vars.tenant }}-{{ .vars.environment }}-{{ .vars.stage }}"Andriy Knysh (Cloud Posse)
12/04/2025, 6:29 PM_default.yaml would have its own namespaceAndriy Knysh (Cloud Posse)
12/04/2025, 6:30 PMatmos terraform apply <component> -s acme1-plat-use1-devAndriy Knysh (Cloud Posse)
12/04/2025, 6:31 PMErik Osterman (Cloud Posse)
12/04/2025, 6:31 PMErik Osterman (Cloud Posse)
12/04/2025, 6:31 PMAndriy Knysh (Cloud Posse)
12/04/2025, 6:32 PMErik Osterman (Cloud Posse)
12/04/2025, 6:32 PMErik Osterman (Cloud Posse)
12/04/2025, 6:32 PMMiguel Zablah
12/04/2025, 6:51 PMMiguel Zablah
12/04/2025, 6:53 PMMiguel Zablah
12/04/2025, 6:54 PMMiguel Zablah
12/04/2025, 6:55 PMorg name as prefix will work but this will be a bunch of refactoring the tf state so either way a big refactor is coming hahahaAndriy Knysh (Cloud Posse)
12/04/2025, 6:58 PMAndriy Knysh (Cloud Posse)
12/04/2025, 6:59 PMAndriy Knysh (Cloud Posse)
12/04/2025, 6:59 PMAndriy Knysh (Cloud Posse)
12/04/2025, 7:02 PMacme1 org, and the stack name pattern for it was tenant-environment-stageAndriy Knysh (Cloud Posse)
12/04/2025, 7:04 PM_defaults.yaml for acme1 org, you have
terraform:
vars:
label_order:
- tenant
- environment
- stage
- name
- attributes
descriptor_formats:
account_name:
format: "%v-%v"
labels:
- tenant
- stage
stack:
format: "%v-%v-%v"
labels:
- tenant
- environment
- stageAndriy Knysh (Cloud Posse)
12/04/2025, 7:04 PMacme2 to orgsAndriy Knysh (Cloud Posse)
12/04/2025, 7:04 PM_defaults.yaml for acme2, you would use
erraform:
vars:
label_order:
- namespace
- tenant
- environment
- stage
- name
- attributes
descriptor_formats:
account_name:
format: "%v-%v"
labels:
- tenant
- stage
stack:
format: "%v-%v-%v-%v"
labels:
- namespace
- tenant
- environment
- stageAndriy Knysh (Cloud Posse)
12/04/2025, 7:05 PMatmos.yaml, you would change
name_template: "{{ .vars.namespace }}-{{ .vars.tenant }}-{{ .vars.environment }}-{{ .vars.stage }}"Andriy Knysh (Cloud Posse)
12/04/2025, 7:06 PMacme1 will not have the namespace in their names, then the resources would remain the same
the stack names change, so even for the old org you would use acme1-plat-use1-prodAndriy Knysh (Cloud Posse)
12/04/2025, 7:06 PMAndriy Knysh (Cloud Posse)
12/04/2025, 7:07 PMMiguel Zablah
12/04/2025, 7:14 PMlabel_order and the descriptor_formats changes how name_template works? so for acme1 it removed the now default namespace prefix from the name_template for this org? but keeps it for the rest in this case just acme2?Andriy Knysh (Cloud Posse)
12/04/2025, 7:17 PMnamespace to the stack names (to be able to distinguish b/w acme1 and acme2 stacks)
⢠for the old acme1 org, keep the same label_order and the descriptor_formats so the names/IDs of the resources remain the same. In this case, you still use stack names with the namespace (e.g. acme1-plat-use1-dev , but the namesapce is 'virtual' to sutttisfy the atmos stack name template
⢠for the new acme2 org, use namespace in the resource names (so they don't collide with the already provisioned resources in acme1Andriy Knysh (Cloud Posse)
12/04/2025, 7:18 PMAndriy Knysh (Cloud Posse)
12/04/2025, 7:19 PMMiguel Zablah
12/04/2025, 7:21 PMAndriy Knysh (Cloud Posse)
12/04/2025, 7:21 PMMiguel Zablah
12/04/2025, 7:45 PMMiguel Zablah
12/04/2025, 9:51 PMMiguel Zablah
12/04/2025, 9:53 PMMiguel Zablah
12/04/2025, 9:59 PM!terraform.state calls so refactor is need it to add the namespace when calling other stacks for exampleAndriy Knysh (Cloud Posse)
12/04/2025, 10:08 PMAndriy Knysh (Cloud Posse)
12/04/2025, 10:08 PMMiguel Zablah
12/04/2025, 10:11 PMnamespace not avaailable when calling !terraform.state?Andriy Knysh (Cloud Posse)
12/04/2025, 10:11 PM!terraform.state uses the same stack name template from atmos.yamlMiguel Zablah
12/04/2025, 10:11 PM_defaults.yaml even do it mention that you can only do it on stack level heheAndriy Knysh (Cloud Posse)
12/04/2025, 10:12 PMAndriy Knysh (Cloud Posse)
12/04/2025, 10:12 PMAndriy Knysh (Cloud Posse)
12/04/2025, 10:13 PMAndriy Knysh (Cloud Posse)
12/04/2025, 10:13 PMMiguel Zablah
12/04/2025, 10:17 PMMiguel Zablah
12/04/2025, 10:18 PMMiguel Zablah
12/04/2025, 10:37 PMGabriela Campana (Cloud Posse)
12/04/2025, 10:44 PMMiguel Zablah
12/05/2025, 3:31 AM_defaults.yaml?
https://atmos.tools/components/terraform/workspaces/Miguel Zablah
12/05/2025, 3:36 AMterraform_workspace_pattern and update the name_pattern to have the namespaceMiguel Zablah
12/05/2025, 3:38 AMterraform_workspace_pattern manage also the name to look for in the terraform backend this basically solves all our previous attempts do this with labels. and actually labels changes have an unintentional impacts when naming components use namespaceAndriy Knysh (Cloud Posse)
12/05/2025, 3:40 AMterraform_workspace_pattern is under metadata which is currently per component - you can define it per component, but I understand it's a lot of configuration
(on the other hand, workspace_key_prefix is under backend so it can be defined globally)
we have a task to make it globally configurable, we can impelement it and release in the next release (prob next week)Miguel Zablah
12/05/2025, 3:42 AM