AndrewChubatiuk / terraform-provider-ssh

This provider enables SSH port forwarding in Terraform.
Mozilla Public License 2.0
8 stars 9 forks source link

Windows support #3

Closed Mattie112 closed 2 years ago

Mattie112 commented 2 years ago

Hi,

Would you also consider having support for Windows? When looking at the code it looks like there should be somekind of support but as you start sh it won't work on Windows.

https://github.com/AndrewChubatiuk/terraform-provider-ssh/blob/v0.14/provider/data_source_ssh_tunnel.go#L288

AndrewChubatiuk commented 2 years ago

Hi @Mattie112 Sorry for a late reply. I've just added a small change and tried it on windows. It'll appear in next release

Mattie112 commented 2 years ago

Hi Andrew,

Sorry for the late reply as wel, am currently running Linux at the office so it took some time to get around on trying it at home.

For me it still does not seem to work:

╷
│ Error: exec: "sh": executable file not found in %PATH%
│
│   with data.ssh_tunnel.mysql,
│   on main.tf line 65, in data "ssh_tunnel" "mysql":
│   65: data "ssh_tunnel" "mysql" {
│
╵
╷

My terraform lock contains:


provider "registry.terraform.io/andrewchubatiuk/ssh" {
  version     = "0.1.5"
  constraints = "0.1.5"
  hashes = [
    "h1:W9ewz3qqWJoOcnBQDJ69C/fag/YRJDus+hPBdixsRZM=",

so I should be on the latest version.

I am running this on Windows 11 via PowerShell

AndrewChubatiuk commented 2 years ago

@Mattie112 do not use terraform locks when running terraform on multiple platforms, lock is applied not to a version but to a certain binary