通过以下 terraform脚本创建blob时遇到问题。
provider "azurerm" {
subscription_id = ""
client_id = ""
client_secret = ""
tenant_id = ""
}
resource "azurerm_resource_group" "test" {
name = "samplevhdtestrg"
location = "Central US"
}
resource "azurerm_storage_account" "test" {
name = "acctestacc"
resource_group_name = "${azurerm_resource_group.test.name}"
location = "westus"
account_type = "Standard_LRS"
}
resource "azurerm_storage_container" "test" {
name = "vhds"
resource_group_name = "${azurerm_resource_group.test.name}"
storage_account_name = "${azurerm_storage_account.test.name}"
container_access_type = "private"
}
resource "azurerm_storage_blob" "testsb" {
name = "sample.vhd"
resource_group_name = "${azurerm_resource_group.test.name}"
storage_account_name = "${azurerm_storage_account.test.name}"
storage_container_name = "${azurerm_storage_container.test.name}"
source_uri = "https://samplevhdtestrg.blob.core.windows.net/system/Microsoft.Compute/Images/images2/d054f6c4-3827-434c-8733-785785ff12ed.vhd"
type = "page"
size = 5120
}
~
这里我试图将现有的vhd克隆到新创建的blob中。但是我在'terraform plan'
中遇到了验证失败的问题azurerm_storage_blob.testsb ::无效或未知密钥:source_uri
我尝试使用'source'属性值来复制文件系统中的vhd。但它也失败了,给出了以下错误
azurerm_storage_blob.testsb ::无效或未知密钥:来源
我的目的是创建一个自定义的ubuntu映像作为新创建的VM的vhd。对此的任何帮助都非常感谢。