Charles Smith
03/23/2026, 2:29 PMworkspace_key_prefix all over our stacks to ensure state keys were what we expected. I can see now, however, there is new guidance and a name element in component metadata. Basically I'm talking about this recommendation:
https://atmos.tools/design-patterns/version-management/folder-based-versioning#recommended-use-metadataname
I like this idea as it's very clean and readable in the stack config.
Sorry now to my actual question. Is it true that if you rely on the default atmos behaviour of using the component (or it's new name) that your state bucket will be a flat listing of all your deployed components? I like to have a little hierarchy in my components to add some organization and I liked that when I set workspace_key_prefix this path structure can be mirrored in the state bucket. But when I don't set workspace_key_prefix it seems that atmos always replaces all / in the component (or name ) with -.
Is there any way to control this or do I need to keep specifying workspace_key_prefix if I want a less flat state organization?Gabriela Campana (Cloud Posse)
03/23/2026, 7:26 PMAndriy Knysh (Cloud Posse)
03/23/2026, 8:58 PMI think this is the most relevant section of the docs for you as it defines how atmos decides that the workspace_key_prefix is derived which then decides where the state is in the bucket:
<https://atmos.tools/design-patterns/version-management/folder-based-versioning#how-atmos-calculates-workspace_key_prefix>
If you actually set workspace_key_prefix to something static in your top level backend.s3 then it would actually be the same state file for all (which would not be good).
But based on these docs if you do not define workspace_key_prefix then it should default to the component name (and then the actual workspace is a dir under that).Andriy Knysh (Cloud Posse)
03/23/2026, 8:59 PMworkspace_key_prefix , Atmos calculates it, and in the state bucket you'll see the workspace_key_prefixes folders with the workspace subfolders (which in almost all caes are the stack names)Charles Smith
03/23/2026, 9:04 PM/ in component names with - when it determines the workspace_key_prefix for you? I would like to organize my components in directories and then reference them like services/consul in my stack config. But it seems like the state bucket will always be a flat listing of all components as atmos turns this into services-consul/workspace-name/statefile.Charles Smith
03/23/2026, 9:07 PMterraform:
backend:
s3:
workspace_key_prefix: "{{ .component }}"
and I do get services/consul/workspace-name/statefile but then I can't use the new name metadata or cleaner way.Andriy Knysh (Cloud Posse)
03/23/2026, 9:07 PM/ with - in the component names), then the folder/subfolder structure would be completely differentAndriy Knysh (Cloud Posse)
03/23/2026, 9:08 PMservices/consul/workspace-name/statefileAndriy Knysh (Cloud Posse)
03/23/2026, 9:09 PMservices-consul/workspace-name/statefile ?Charles Smith
03/23/2026, 9:10 PMAndriy Knysh (Cloud Posse)
03/23/2026, 9:10 PMservices/consul/workspace-name/statefileAndriy Knysh (Cloud Posse)
03/23/2026, 9:11 PMterraform:
backend:
s3:
workspace_key_prefix: "{{ .component }}"Andriy Knysh (Cloud Posse)
03/23/2026, 9:11 PMmetadata.name ?Charles Smith
03/23/2026, 9:11 PMAndriy Knysh (Cloud Posse)
03/23/2026, 9:12 PMmetadata.name and don't change it
thanks for reporting, we'll take a lookCharles Smith
03/23/2026, 9:14 PMworkspace_key_prefix line in the backend config so atmos would generate it based on component or metadata.name . When I do that then the generated prefix has no / in it. Yeah okAndriy Knysh (Cloud Posse)
03/23/2026, 9:15 PMbased on component or metadata.name . When I do that then the generated prefix has no / in it.Charles Smith
03/23/2026, 9:16 PMAndriy Knysh (Cloud Posse)
03/23/2026, 9:16 PMatmos.yaml for you to override the behavior
we don't want to just change it b/c it will break a lot of exsiting configsCharles Smith
03/23/2026, 9:16 PM