Identified regression in 0.14.0-rc: multi-line output is incorrectly rendered (rendered without newline characters).
Terraform v0.14.0-rc1
output "my_out" {
value = <<EOF
This is a
multiline
string.
EOF
}
Expected behavior is that the output is rendered with newline characters. This is especially important for longer strings and strings which pass URLs as part of a pre-formatted output string.
This is the output from 0.12.x and 0.13.x:
my_out = This is a
multiline
string.
Output does not render newlines but mashes multiple lines together. This breaks links and makes longer output strings unreadable to the user.
my_out = This is a\nmultiline\nstring.
terraform apply or terraform outputThis is especially important for modules which pass usability info (esp. links and other info) on to consumer of the module.
Thanks for reporting this, @aaronsteers. I've confirmed the issue in Terraform 0.14.0-rc1.
This change is a consequence of the change in console and output rendering, which aimed to ensure that these values were presented as valid HCL values. The fix will require rendering strings containing newlines in the heredoc format.
There's a fix pending review in #27045. With that branch, the original reproduction case here renders as follows:
$ terraform apply -auto-approve
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
my_out = <<EOT
This is a
multiline
string.
EOT
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
There's a fix pending review in #27045. With that branch, the original reproduction case here renders as follows: