Terraform Azurerm错误:linuxConfiguration.ssh.publicKeys.path无效
我正在将Terraform v0.12.24与provider.azurerm v2.2.0一起使用 当我尝试创建scaleset VM时,出现以下错误: 错误:compute.VirtualMachineScaleSetsClient#CreateOrUpdate:失败 发送请求:StatusCode=400——原始错误: Code=“InvalidParameter”Message=“参数的值 linuxConfiguration.ssh.publicKeys.path无效。“ Target=“linuxConfiguration.ssh.publicKeys.path” 在scaleset.tf第1行的资源中 “azurerm\u虚拟机\u规模\u集”“演示”:1:资源 “azurerm\u虚拟机\u比例\u集”“演示”{ 我使用Windows 10进行terraform配置。我的操作系统配置文件linux配置如下:Terraform Azurerm错误:linuxConfiguration.ssh.publicKeys.path无效,terraform,terraform-provider-azure,Terraform,Terraform Provider Azure,我正在将Terraform v0.12.24与provider.azurerm v2.2.0一起使用 当我尝试创建scaleset VM时,出现以下错误: 错误:compute.VirtualMachineScaleSetsClient#CreateOrUpdate:失败 发送请求:StatusCode=400——原始错误: Code=“InvalidParameter”Message=“参数的值 linuxConfiguration.ssh.publicKeys.path无效。“ Target
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创建的,另一个是由带有git bash的ssh keygen创建的。这两个密钥对都有相同的错误。
您知道吗?对于您的问题,我认为您误解了ssh\u密钥的属性
path
,如下所示:
ssh_密钥-(可选)指定要访问的路径和密钥数据的集合
被放置在虚拟机上
您要创建的是VM内部的路径,而不是执行Terraform的机器的路径。此外:
注意:请注意,唯一允许的路径是
/由于Azure的限制,home/.ssh/authorized_密钥