Skip to content

Commit

Permalink
Correctly escape quotes when converting var.env map to string
Browse files Browse the repository at this point in the history
Fixes a bug introduced in 9da504a the correct use is replace(string, this,
that)
  • Loading branch information
dwaynebailey authored and flaupretre committed Aug 18, 2023
1 parent f2f1e7e commit d6c1117
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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("\n", [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
Expand Down

0 comments on commit d6c1117

Please sign in to comment.