Paavo Pokkinen
06/09/2026, 1:10 PMPaulo Gomes
06/09/2026, 1:23 PM!terraform.state returns a parsed YAML value, so objects come back as objects, not strings. To force it to a string you need to combine it with a template function and `toJson`:
my_var: !template '{{ toJson (terraform.state "component" "stack" ".outputs.my_output") }}'
YAML functions and template functions operate at different layers. YAML functions parse into structured data, template functions work on raw text before parsing. When you need the JSON string rather than the object, template + toJson is the way to go.Erik Osterman (Cloud Posse)
06/09/2026, 2:49 PMErik Osterman (Cloud Posse)
06/09/2026, 2:49 PMErik Osterman (Cloud Posse)
06/09/2026, 2:49 PMErik Osterman (Cloud Posse)
06/09/2026, 2:50 PMErik Osterman (Cloud Posse)
06/09/2026, 2:51 PMErik Osterman (Cloud Posse)
06/09/2026, 2:51 PMErik Osterman (Cloud Posse)
06/09/2026, 2:52 PMErik Osterman (Cloud Posse)
06/09/2026, 2:53 PM1.221.0 we are introducing {{ atmos.Resolve ... } which can resolve any section of atmos stack config that uses a YAML function.Erik Osterman (Cloud Posse)
06/09/2026, 2:54 PMsettings:
context:
something: !somefunction
vars:
foo: {{ atmos.Resolve .settings.context.something }}Erik Osterman (Cloud Posse)
06/09/2026, 2:55 PM!anything must appear first after the key as a value, you cannot retreat !anything as an interpolated value.Erik Osterman (Cloud Posse)
06/09/2026, 2:55 PMPaulo Gomes
06/15/2026, 10:47 AMatmos.Resolve is coming, that's a cleaner solution than reaching for templating. Will keep an eye on 1.221.0Erik Osterman (Cloud Posse)
06/15/2026, 8:19 PM1.221.0 was released 😃 (1.221.1 even!)