Wade
09/26/2025, 1:13 AMtpl function (tmpl.Inline) from gomplate been disabled in Atmos? We have tried using both but it complains that the function does not exist so we had to resort to this abomination that renders a template to be rendered on the second pass:
{{- print `{{ toJson (data.YAML ` "`" }}
#build a template to render on the second pass
{{- print "`" `) }}` }}
The fact that data.YAML works proves that we have gomplate enabled, as well as sprig's toJson.Andriy Knysh (Cloud Posse)
09/26/2025, 1:19 AMsprig:
# Enable Sprig functions in `Go` templates in Atmos stack manifests
enabled: true
# https://docs.gomplate.ca
# https://docs.gomplate.ca/functions
gomplate:
# Enable Gomplate functions and data sources in `Go` templates in Atmos stack manifests
enabled: trueAndriy Knysh (Cloud Posse)
09/26/2025, 1:20 AMatmos.yaml, then all gomplate and Sprig functions are enabled - Atmos does not disable anything from the libs. But it might be not supported by the Go gomplate lib that Atmos usesAndriy Knysh (Cloud Posse)
09/26/2025, 1:21 AMAndriy Knysh (Cloud Posse)
09/26/2025, 1:22 AMWade
09/26/2025, 1:29 AMvars:
test: |-
{{ tpl "test" $ }}
{{ tmpl.Inline "test" $ }}
if you put that anywhere in your stack it will error with
template: templates-all-atmos-sections:1689: function "tpl" not defined
for the first line and
template: templates-all-atmos-sections:1689: function "tmpl" not defined
for the second lineRed_M
09/26/2025, 2:02 AMtemplate won't work either, atmos includes the section more than once so the golang template sees it being defined more than onceRed_M
09/26/2025, 2:03 AM{{define "T1"}}hello, world!{{end}}{{ tmpl.Exec "T1" | strings.ToUpper }}Red_M
09/26/2025, 2:05 AMRed_M
09/26/2025, 2:06 AMdig which doesn't have an overlapping function in gomplateRed_M
09/26/2025, 2:06 AMRed_M
09/26/2025, 2:12 AMRed_M
09/26/2025, 3:14 AMAndriy Knysh (Cloud Posse)
09/26/2025, 4:18 AMAndriy Knysh (Cloud Posse)
09/26/2025, 4:33 AMAndriy Knysh (Cloud Posse)
09/26/2025, 4:37 AM{{define "T1"}}hello, world!{{end}}{{ tmpl.Exec "T1" | strings.ToUpper }} don't need any context, they can be evaluated by just reading the YAML stack config file where the template is defined. But this is usually not the case since almost all templates need context (unless we read from external sources like files or ENV variables)
• Templates like {{ .vars.vpc_id }} or {{ .settings.context.stage }} requite context, which in this case is the final values of all Atmos sections after Atmos finds the component in the stack - these templates are used all the time in stack configAndriy Knysh (Cloud Posse)
09/26/2025, 4:39 AMAndriy Knysh (Cloud Posse)
09/26/2025, 4:43 AMatmos validate stacks command (https://atmos.tools/cli/commands/validate/stacks) to do template validation, and detect the first type of templates and any issues related to them (e.g. a template function does not exist) and show the exact file name/pathRed_M
09/28/2025, 11:10 PM