Loading...
Loading...
### Terraform Version ``` Terraform v0.12.6 + provider.aws v2.22.0 ``` ### Terraform Configuration Files <!-- Paste the relevant parts of your Terraform configuration between the ``` marks below. For large Terraform configs, please use a service like Dropbox and share a link to the ZIP file. For security, you can also encrypt the files using our GPG public key. --> ```hcl resource "aws_instance" "build-slave" { count = var.servers ami = data.aws_ami.windows_2016.id instance_type = var.instance_type key_name = var.key_pair get_password_data = "true" vpc_security_group_ids = var.security_groups subnet_id = var.subnet # Ugly but I can't find a better way to create the name for this tags = merge({"Name": "${var.name_prefix}${var.start_index+count.index}"},local.tags) volume_tags = merge({"Name": "${var.name_prefix}${var.start_index+count.index}"},local.tags) user_data = <<EOF Set-Item wsman:\localhost\Client\TrustedHosts -value * -Force Set-Item wsman:\localhost\MaxTimeoutms -value 7200000 -Force EOF connection { host = self.private_ip type = "winrm" user = "Administrator" password = rsadecrypt(self.password_data, file(local.ssh_key)) use_ntlm = true } provisioner "remote-exec" { inline = [ "powershell.exe Start-Sleep 3600" ] } } ``` ### Debug Output Nothing related to the output here. Can give as requested however. ### Expected Behavior <!-- What should have happened? --> The remote-exec provisioner should wait for the sleep to complete. ### Actual Behavior <!-- What actually happened? --> An error is throw with the error message operation timed out > Error: error executing "C:/Temp/terraform_1073038997.cmd": unknown error Post http://10.0.0.0.10:5985/wsman: read tcp 10.0.0.20:64215->10.0.0.10:5985: read: operation timed out ### Steps to Reproduce <!-- Please list the full steps required to reproduce the issue, for example: 1. `terraform init` 2. `terraform apply` --> 1. `terraform init` 2. `terraform apply` ### Additional Context I have run similar commands using the winrm-cli ` winrm-cli -hostname 10.0.0.30 -insecure -username Admin -password '12345' 'powershell.exe Start-Sleep 3600'` and have had the command succeed. I originally discovered this when attempting to run a chef provisioner and having the timeout effect the success of my cookbook. Attempting to set the `MaxTimeoutms` to 120 minutes didn't fix the error. When running `kitchen bootstrap winrm` against instances provisioned with this code without the provision blocks succeeds in fully running cookbook. The instance is created with an ami thats has winrm already configured and nothing else. ```powershell stop-service winrm winrm quickconfig -q winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="2048"}' winrm set winrm/config '@{MaxTimeoutms="1800000"}' winrm set winrm/config/client '@{AllowUnencrypted="true"}' winrm set winrm/config/service '@{AllowUnencrypted="true"}' winrm set winrm/config/service/auth '@{Basic="true"}' netsh advfirewall firewall add rule ` name="Enable WinRM" dir=in action=allow protocol=TCP ` localport=5985 start-service winrm ```
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.