我编写了一些 Terraform 代码来创建 Azure 存储帐户。这是代码:
resource "azurerm_storage_account" "i_ten_prov_storage" {
name = "${var.storage_account_name}"
resource_group_name = "${azurerm_resource_group.i_resource_group.name}"
location = "${var.location}"
account_tier = "Standard"
account_replication_type = "LRS"
account_kind = "StorageV2"
/* cors_rule {
allowed_headers = "${var.allowed_headers}"
allowed_methods = "${var.allowed_methods}"
allowed_origins = "${var.allowed_origins}"
exposed_headers = "${var.exposed_headers}"
max_age_in_seconds = "${var.max_age_in_seconds}"
}*/
cors_rule {
allowed_headers = ["*"]
allowed_methods = ["*"]
allowed_origins = ["*"]
exposed_headers = ["*"]
max_age_in_seconds = ["*"]
}
tags = "${local.tags}"
}
我正在关注这个文档,它说在 Terraform 中允许 CORS 用于 azure 存储帐户: https ://www.terraform.io/docs/providers/azurerm/r/storage_account.html#allowed_headers
但是我在运行时收到以下错误terraform apply
:
Error: azurerm_storage_account.idl_tenant_provisioning_storage: : invalid or unknown key: cors_rule
ERROR: Job failed: exit code 1
我正在使用 Terraform 0.11.11。
从 azure 门户中,我可以看到 cors 可以单独应用于各种存储
我想申请各种对象