Kyle Decot
03/20/2026, 5:12 PM!terraform.state? For example:
terraform:
secretsmanager:
vars:
hello_world: !terraform.state hello .world # string containing: "{\"hello\": \"world\"}"
Here I want the "raw" string however atmos is trying to help me and instead gives me a map 😢Dan Hansen
03/20/2026, 5:24 PM. | to_json https://mikefarah.gitbook.io/yq/operators/encode-decode#encode-value-as-json-stringKyle Decot
03/20/2026, 5:29 PMError: invalid number of arguments in the Atmos YAML function !terraform.state
terraform:
secretsmanager:
vars:
hello_world: !terraform.state hello .world | to_json # string containing: "{\"hello\": \"world\"}"
Perhaps I'm misunderstanding how to use yq expressions in this context?
Thanks for the help!Dan Hansen
03/20/2026, 5:30 PMpostgres_url: !terraform.state hello ". | to_json"
https://atmos.tools/functions/yaml/terraform.state#using-yq-expressions-to-modify-values-returned-from-the-remote-stateKyle Decot
03/20/2026, 5:33 PMDan Hansen
03/20/2026, 5:34 PM