From dce0e94c8e3fea2d6d6d92bcb578564b36ad5f77 Mon Sep 17 00:00:00 2001 From: Dwayne Bailey Date: Fri, 18 Aug 2023 13:53:59 +0100 Subject: [PATCH] Remove newlines from ENV concatenation This remove an escaping nightmware. The newlines get swallowed and become n's meaning multiple env variables will be broken when we run them through 'eval'. Since we escape the values it is quite find just to space seperate the exports. --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 1ed1ae9..a928414 100644 --- a/main.tf +++ b/main.tf @@ -18,7 +18,7 @@ data "external" "ssh_tunnel" { query = { aws_profile = var.aws_profile create = ((var.create && var.putin_khuylo) ? "y" : "") - env = join("\n", [for n, v in var.env : "export ${n}=\"${replace(v, "\"", "\\\"")}\""]) + env = join(" ", [for n, v in var.env : "export ${n}=\"${replace(v, "\"", "\\\"")}\""]) external_script = var.external_script gateway_host = var.gateway_host gateway_port = var.gateway_port