I cant get aws instance provisioned because its stuck and failing at this block
any idea why it is failing.
Copy Scripts to EC2 instance
provisioner “file” {
source = “${path.module}/activedirectory/”
destination = “C:\scripts”
connection {
host = coalesce(self.public_ip, self.private_ip)
type = “winrm”
user = “Administrator”
password = var.admin_password
agent = “false”
}
}
Set Execution Policy to Remote-Signed, Configure Active Directory
provisioner “remote-exec” {
connection {
host = coalesce(self.public_ip, self.private_ip)
type = “winrm”
user = “Administrator”
password = var.admin_password
agent = “false”
https = “true”
port = “5986”
insecure = “true”
}
inline = [
“powershell.exe Set-ExecutionPolicy RemoteSigned -force”,
“powershell.exe -version 4 -ExecutionPolicy Bypass -File C:\scripts\01-ad_init.ps1”,
]
}
}