I am attempting to use the script argument with the remote-exec terraform Provisioner. According to the documentation, the script argument does the following:
script - This is a path (relative or absolute) to a local script that will be copied to the remote resource and then executed. This cannot be provided with inline or scripts.
Here is a link to the doc: https://www.terraform.io/docs/language/resources/provisioners/remote-exec.html
Here is the code:
script = [
"./scripts/provision.sh"
]
Here is the error:
Error: Incorrect attribute value type
on main.tf line 86, in resource "vsphere_virtual_machine" "vm":
86: script = [
87: "./scripts/provision.sh",
88: ]
Inappropriate value for attribute "script": string required.
Any help would be appreciated.
I am new to TF - script does not take a list, which is defined by using [ ] square brackets. The solution is to use
script = "./scripts/provision.sh"