atmos icon indicating copy to clipboard operation
atmos copied to clipboard

terraform.output YAML function doesn't not handle newlines correctly

Open kyledecot opened this issue 9 months ago • 1 comments
trafficstars

Describe the Bug

If you output a value that has multiple newlines and then attempt to use that value in another stack via terraform.output the newlines will be striped.

Expected Behavior

output value should retain newline characters

Steps to Reproduce

In stack #1 (a) output a value that contains newlines such as:

output "foo" {
  value = "bar\nbaz\nbongo\n"
}

Then in stack #2 (b) use that value as an var to a component:

components:
  terraform:
    hello:
      vars:
        foo: !terraform.output a .foo

Screenshots

No response

Environment

Terraform v1.10.4 on darwin_arm64
Atmos 1.153.1 on darwin/arm64

Additional Context

No response

kyledecot avatar Jan 28 '25 15:01 kyledecot

Wow, that should definitely not happen! Thanks for reporting. We’ll fix this and add a test case.

osterman avatar Jan 29 '25 13:01 osterman