I am using winrm to remote-exec on aws windows instance:
provisioner "remote-exec" {
script = "PrepareWindows.cmd"
connection {
type = "winrm"
user = "administrator"
password = "${var.adminPassword}"
}
}
The script returns error: dial tcp
52.8.100.117:5985: operation timed out. I have confirmed that the password is correct.
I guess it is because the windows vm need long time to initialize and terraform need to wait before making the connection.
How to make terraform wait? Thanks for any clue.