Terraform remote-exec variable passing
<p>I am looking to pass variables to a script on a new created aws_instance, but I'm not sure how. Here is what I have: </p>

<pre><code>provisioner "file" {
    source      = "${path.module}/scripts/slave-provisioner.sh"
    destination = "/tmp/slave-provisioner.sh"
}

provisioner "remote-exec" {
    inline = [
        "chmod +x /tmp/slave-provisioner.sh",
        "sudo /tmp/slave-provisioner.sh ${split(",",var.zookeeper_ips_list)}"
    ]
}
</code></pre>

<p>I have verified that the zookeeper_ips_list has the correct list of IPs. </p>

<p>There error that I get via terraform apply is: </p>

<pre><code> /tmp/terraform_939984059.sh: 5: /tmp/terraform_939984059.sh: 10.239.12.181: not found
</code></pre>

<p>So basically I want to create this machine and then kick of my provisioner script that gets passed a list of IPs so it can do it's configuration. </p>