Render Multiline String to One line

I’m using terraform-aws-eks

and in the self-managed nodegroup section example in terraform-aws-eks/ at master · terraform-aws-modules/terraform-aws-eks · GitHub
it was one line string

afraid if multiline string like below is failed :

bootstrap_extra_args = <<-EOT
--container-runtime containerd \
--kubelet-extra-args ' \
--register-with-taints=cluster-core-tools=true:NoExecute \
--node-labels=nodegroup-name=nodegroup-xxx, \

is there a way to convert multiline string to one line string in the terraform ?

Hi @petrukngantuk1,

To achieve this will require deciding how you want to transform the newline characters so that they are no longer present in the final string.

Because this seems to be a command line arguments string, perhaps a suitable answer would be to replace all of the newline characters with spaces. If that would be acceptable to you then you could achieve that using Terraform’s built-in replace function.