TerraForm Azurerm错误:linuxConfiguration.ssh.public Keys.path无效 [英] Terraform Azurerm error: linuxConfiguration.ssh.publicKeys.path is invalid
本文介绍了TerraForm Azurerm错误:linuxConfiguration.ssh.public Keys.path无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将Terraform v0.12.24与Provider.azurerm v2.2.0一起使用 尝试创建缩放集虚拟机时收到以下错误:
错误:compute.VirtualMachineScaleSetsClient#CreateOrUpdate:失败 发送请求:StatusCode=400--原始错误: code="InvalidParameter"message="参数值 linuxConfiguration.ssh.public Keys.path无效。" Target="linuxConfiguration.ssh.publicKeys.path" 在scaleset.tf行1上,资源中 "azurerm_virtual_machine_scale_set""demo":1:资源 "azurerm_virtual_Machine_scale_set""demo"{
我正在使用Windows 10进行Terraform配置。我的os_profile_linux_config如下:
storage_profile_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "18.04-LTS"
version = "latest"
}
os_profile_linux_config {
disable_password_authentication = true
ssh_keys {
key_data = file("C:/Users/jack/Documents/key/id_rsa.pub")
path = "C:/Users/jack/Documents/key"
}
}
首先,我尝试了两个不同的密钥对。一个由puttygen创建,另一个由ssh-keygen和git bash创建。我对他们两个都犯了同样的错误。
你有什么想法吗?
推荐答案
对于您的问题,我认为您误解了ssh_key的属性path
,如下所示:
ssh_key-(可选)指定要访问的路径和key_data的集合 放在虚拟机上。您要创建的是VM内部的路径,而不是执行Terraform的计算机的路径。还有:
注意:请注意,唯一允许的路径是 /HOME//.ssh/AUTHORIZED_KEYS,这是由于Azure的限制。
这篇关于TerraForm Azurerm错误:linuxConfiguration.ssh.public Keys.path无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文