I have having issues when using the provisioner file functionality and it is failing with the below error.
Error: Unknown root level key: provisioner
code in my .tf file.
provisioner “file” {
source = “${path.module}/register.sh”
destination = “/tmp/register.sh”
connection {
host = “10.11.9.4”
type = “ssh”
user = “centos”
agent = false
private_key = “{file("{path.module}/id_rsa”)}"
}
}
In variable.tf.
variable “private_key” {
type = “string”
}
…