FYI: Error on doc example: <https://atmos.tools/cl...
# atmos
a
FYI: Error on doc example: https://atmos.tools/cli/configuration/stacks/#advanced-template-with-validation With templating enabled, the advanced name_pattern example works fine for
atmos list staks
but fails with a templating error for
atmos tf plan some_component
. What works for me is this:
Copy code
name_template: |-
  {{ $ns := .vars.namespace -}}
  {{- $tenant := .vars.tenant -}}
  ....
  {{- $stack_name }}
Note the removed "-" at the beginning of the first line and at the end of the last line.
e
Yes, the name pattern should be avoided at all costs.
This was the opinionated pattern we implemented early on in atmos. And throughout our documentation, we should mention that it has been deprecated. It's supported because a lot of older installations still use it.
I would recommend trying to construct your name template like this:
Copy code
name_template: '{{ list .vars.namespace .vars.stage .vars.environment .vars.name | compact | join "-" }}'
As for the bug you found, I'll dispatch that to co-pilot.
a
Argh, sorry for mentioning name_pattern, that was a "typo", I've only been using name_template. The reported issue was with name_template.