title: Terraform v0.12 Multi-line String EOF shell-style "here doc" syntax not been interpreted as before with v0.11
body: <p>Within Octopus Deploy I've setup a Terraform Apply Step using their Apply a Terraform template</p>
  
  <p>In my Terraform main.tf file I want to use a connection to run an remote-exec on a Amazon Linux EC2 instance in AWS</p>
  
  <pre><code>    resource "aws_instance" "nginx" {
        ami           = "${var.aws_ami}"
        instance_type = "t2.nano"
        key_name      = "${var.key_name}"
  
        connection {
          type        = "ssh"
          user        = "ec2-user"
          private_key = "${var.aws_key_path}"
        }
  
        provisioner "remote-exec" {
          inline = [
            "sudo amazon-linux-extras install epel -y",
            "sudo yum update -y",
            "sudo amazon-linux-extras install nginx1.12 -y",
            "sudo systemctl enable nginx.service",
            "sudo systemctl start nginx.service",
            "sudo systemctl status nginx.service"
          ]
        }
      }
  </code></pre>
  
  <p>As part of the connection block we need to connect using an SSH key pair using a Private Key PEM to auth with the Public Key stored on AWS</p>
  
  <p>My Private Key is stored as a variable in my Project in Octopus deploy</p>
  
  <p>For my private key to be interpreted correctly in Terraform as a multi-line string I had to use 'here doc' syntax using a starting EOF and an ending EOF</p>
  
  <p>This syntax explanation can be found on the Terraform official documentation at</p>
  
  <p><a href="https://www.terraform.io/docs/configuration-0-11/syntax.html" rel="noreferrer">https://www.terraform.io/docs/configuration-0-11/syntax.html</a></p>
  
  <p>This was my original problem that my variable syntax was falling over as I wasn't handling the multi-line PEM file correctly and I raised the ticket below with Octopus Deploy Support</p>
  
  <p><a href="https://help.octopus.com/t/terraform-apply-step-pem-variable-set-to-unix-lf-ucs-2-le-bom/23659" rel="noreferrer">https://help.octopus.com/t/terraform-apply-step-pem-variable-set-to-unix-lf-ucs-2-le-bom/23659</a></p>
  
  <p>Where they kindly were able to point me in the direction of the EOF syntax</p>
  
  <p>This all worked great on Terraform v0.11 but we've a lot of code here on this side that's been written in the latest HCL2 in v0.12</p>
  
  <p>So I wanted to force Octopus Deploy to use a v0.12 binary rather than the prepackaged v0.11 that Octopus Deploy comes with. And they offer a built in Special var so you can use a different binary</p>
  
  <p>But when I run it with this binary the script blows up with the error below</p>
  
  <pre><code>Error: Unterminated template string
  No closing marker was found for the string. 
  August 6th 2019 14:54:07 Error
  Calamari.Integration.Processes.CommandLineException: The following command: "C:\Program Files\Octopus Deploy\Octopus\bin\terraform.exe" apply -no-color -auto-approve -var-file="octopus_vars.tfvars" 
  August 6th 2019 14:54:07 Error
  With the working directory of: C:\Octopus\Work\20190806135350-47862-353\staging 
  August 6th 2019 14:54:07 Error
  Failed with exit code: 1 
  August 6th 2019 14:54:07 Error
  Error: Unterminated template string 
  August 6th 2019 14:54:07 Error
    on octopus_vars.tfvars line 34:
  </code></pre>
  
  <p>I've had a look at the official documentation for v0.12</p>
  
  <p><a href="https://www.terraform.io/docs/configuration/syntax.html#terraform-syntax" rel="noreferrer">https://www.terraform.io/docs/configuration/syntax.html#terraform-syntax</a></p>
  
  <p>And I'm not sure if there is anything that helps in relation to how to manage multi-line that they had in v0.11</p>
  
  <p>Here is the code block that worked in v0.11 successfully from my tfvars file</p>
  
  <pre><code>aws_ami = "#{ami}"
  key_name = "#{awsPublicKey}"
  aws_private_key = &lt;&lt;-EOF
  #{testPrivateKey}
  -EOF
  </code></pre>
  
  <p>The expected result when I ran this with the latest version of Terraform v0.12.6 was that it would function normally and run my Terraform Apply within Octopus Deploy</p>
  
  <p>My hope here is that someone from Hashicorp has a workaround for this as I see this was supposed to be fixed with <a href="https://github.com/hashicorp/terraform/pull/20281" rel="noreferrer">https://github.com/hashicorp/terraform/pull/20281</a></p>
  
  <p>But I'm using the latest binary at the time of writing this v0.12.6 downloaded today</p>
  
  <p>Any suggestions anyone on how to get this working in v0.12? Cheers</p>