You can use terraform chomp() function to remove a newline character from a string.
Open terraform console
1 2 |
## Open terraform console terraform console |
Remove newline from a string in terraform
1 2 3 4 |
## Remove new line from a string in terraform chomp("hello world\n") ## returns "hello world" in a single line |