Description
Is there an existing issue for this?
- I have searched the existing issues
Example Name
Terraform Version
1.3.8
Current Behavior
@jcorioland
There is an issue when the code generates the connection to the public ip.
In the following line, it tries to connect to the public ip address:
After several days of troubleshooting the code, I found that it fails because the variable not only contains the ip address, but it also includes double quotes around the ip address, this makes it fail.
Expected Behavior
Finally fixed it by using the following change:
//sshConnection, err := ssh.Dial("tcp", fmt.Sprintf("%s:22", vmLinux1PublicIPAddress), sshConfig)
sshConnection, err := ssh.Dial("tcp", fmt.Sprintf("%s:22", strings.Trim(vmLinux1PublicIPAddress, "\"")), sshConfig)
Once that adjustment was done, the code worked!
Steps To Reproduce
cd /c/git/terraform/samples/end-to-end-testing/src/test
az login --use-device-code
az account set --subscription Playground
cd ~/.ssh
ssh-keygen.exe #This is in test, not definitive yet: -m PEM
make sure id_rsa and id_rsa.pub were created
ls -l /.ssh/id_rsa*/.ssh/id_rsa"
export TEST_SSH_KEY_PATH="
cd /c/git/terraform/samples/end-to-end-testing/src/test
go mod download github.com/gruntwork-io/terratest
go mod download github.com/Azure/go-autorest/autorest
go mod tidy -e
go test -v ./ -timeout 10m
Anything else?
No response
Activity