generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Hello,
it seems that plain IPv6 in the host field is unsupported currently.
TL;DR: There is a workaround.
The problem is how the connection address is parsed in connectio.go#L129.
The SSH address for for the go ssh module must be in the format [ipv6]:port with the brackets.
Terraform Version
# terraform -v
Terraform v1.2.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/local v2.2.3
+ provider registry.terraform.io/tenstad/remote v0.1.0Affected Resource(s)
- remote_file
Terraform Configuration Files
data "remote_file" "config" {
conn {
host = "::1"
port = 22
user = "root"
private_key = local.ssh.private_key
}
path = "/somefile.txt"
}Debug Output
data.remote_file.config: Reading...
╷
│ Error: unable to open remote client: couldn't establish a connection to the remote server: dial tcp: address ::1:22700: too many colons in address
│
│ with data.remote_file.config,
│ on test.tf line 1, in data "remote_file" "config":
│ 1: data "remote_file" "config" {
│
╵
Expected Behavior
IPv6 without brackets.
Actual Behavior
The "host" connection string is used to add the port number which leads to that error in go's ssh module (see connectio.go#L129)
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Workaround
Add the brackets [ ] to the host IPv6 address.
data "remote_file" "config" {
conn {
host = "[::1]"
port = 22
user = "root"
private_key = local.ssh.private_key
}
path = "/somefile.txt"
}References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels