cloudposse / atmos

👽 Terraform Orchestration Tool for DevOps. Keep environment configuration DRY with hierarchical imports of configurations, inheritance, and WAY more. Native support for Terraform and Helmfile.
https://atmos.tools
Apache License 2.0
620 stars 86 forks source link

Improve documentation for what is subject to templating #597

Closed joberly closed 3 weeks ago

joberly commented 1 month ago

Describe the Feature

After doing some debug for a cryptic template error (see #596), I discovered that Terraform variable descriptions get imported into an internal template that gets parsed and executed. If a variable description string inadvertently has a Go template action in it which does not work, the templating fails. After looking through the docs here, it didn't seem obvious that Terraform variable metadata is part of the templating process. It would be nice to see some extra documentation that would make this more obvious. It's not obvious this is intentional behavior from Atmos, either.

Expected Behavior

The documentation should call out everything subject to templating so it's more obvious where Go template actions might be problematic.

Use Case

The problem is that if a Go template action is inadvertently added to something outside a stack manifest, this might cause templating to fail and the resulting error is also vague (see #596).

Describe Ideal Solution

Documentation clearly points out what parts of code are subject to templating.

Alternatives Considered

Excluding some parts of the internally generated template from executing might be workable as it doesn't seem obvious this behavior was intended, but it might be too complicated to prevent.

Additional Context

No response

GabisCampana commented 1 month ago

@aknysh DEV-2149 : Improve documentation for what is subject to templating

aknysh commented 3 weeks ago

@joberly We've improved the templating doc, please review https://atmos.tools/core-concepts/stacks/templating/