Reputation: 2217
For readability purpose, I want to set the value of a string on multiple lines but the result would show as a one ligne. I tried to contact using +
but it does not work.
By the way, one of the lines (a part of the string) is resolved at apply time.
example:
output "variable" {
value = "First part "
+ ", then second part "
+ " and final part."
}
and the output.variable will show "First part, then second part and final part."
Upvotes: 1
Views: 2146
Reputation: 200960
you can use the join function:
output "variable" {
value = join("", ["First part ",
", then second part ",
" and final part."])
}
Upvotes: 4
Reputation: 2113
Why don’t you try to concatenate adding a \n character at the end of every variable forming the string? Something like:
output “variable” {
value = “${var}\n${var2}\n”
}
Upvotes: 0