I have written some Terraform code to create an Azure storage account. Here is the code:
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}"
}
I am following this documentation which says that CORS is allowed in Terraform for azure storage account: https://www.terraform.io/docs/providers/azurerm/r/storage_account.html#allowed_headers
But I am getting the following error when I am running terraform apply
:
Error: azurerm_storage_account.idl_tenant_provisioning_storage: : invalid or unknown key: cors_rule
ERROR: Job failed: exit code 1
I am using Terraform 0.11.11.
From the azure portal I can see that cors can be applied seperatly for all kind of storage
and I want to apply for all kind of objects