我正在尝试在这里使用这个配置:
connection {
type = "ssh"
user = "root"
agent = true
private_key = "${file("~/.ssh/id_rsa")}"
}
我遇到了一个错误:
password protected keys are not supported. Please decrypt the key prior to use.
我还尝试去掉private_key
参数。它只需要从ssh-agent读取密钥,但是它不起作用。
Terraform版本为0.9.2
private_key
参数是解决方案的一部分,因为您(可能)想在此处使用安装在 SSH 代理中的密钥,您使用agent = true
指定了该密钥。不幸的是,所有提供程序的 SSH 设置都相当复杂,因此有许多棘手的方式会出现问题,而 Terraform 很难为所有不同情况提供良好的错误消息。 :( - Martin Atkins