gpt4 book ai didi

terraform - 无法使用 indexing_policy block 创建 azurerm_cosmosdb_sql_container

转载 作者:行者123 更新时间:2023-12-04 08:46:28 24 4
gpt4 key购买 nike

根据documentation on Terraform.io对于 azurerm_cosmosdb_sql_container,它说我可以包含一个 indexing_policy 块。但是,当我运行 terraform plan 时我收到错误:

Error: Unsupported block type

on main.tf line 912, in resource "azurerm_cosmosdb_sql_container""AccountActivity": 912: indexing_policy {

Blocks of type "indexing_policy" are not expected here.


main.tf
resource "azurerm_cosmosdb_sql_container" "AccountActivity" {
name = "AccountActivity"
resource_group_name = azurerm_resource_group.backendResourceGroup.name
account_name = azurerm_cosmosdb_account.AzureCosmosAccount.name
database_name = azurerm_cosmosdb_sql_database.AzureCosmosDbCache.name
default_ttl = 2592000
throughput = 2500

indexing_policy {
indexing_mode = "Consistent"

included_path {
path = "/*"
}

excluded_path {
path = "/\"_etag\"/?"
}
}
}
这是我的 terraform version输出:
terraform version
Terraform v0.13.4
+ provider registry.terraform.io/-/azurerm v2.30.0
+ provider registry.terraform.io/hashicorp/azurerm v2.20.0
+ provider registry.terraform.io/hashicorp/random v2.3.0

最佳答案

搜索GitHub后,终于发现添加了对indexing_policy块的支持in this commit 26 days ago .文档没有提到这一点,release notes for azurerm v2.31.1 也没有提到这一点。 .使用最新版本的 azurerm 更新我的 main.tf 文件并运行后 terraform init terraform plan命令工作没有问题。

provider "azurerm" {
version = "~>2.31.1"
features {}
}

关于terraform - 无法使用 indexing_policy block 创建 azurerm_cosmosdb_sql_container,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64289524/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com