gpt4 book ai didi

mongodb - Terraform 选择在 Azure 中使用免费层 cosmosDB 帐户

转载 作者:行者123 更新时间:2023-12-02 07:57:36 38 4
gpt4 key购买 nike

我正在尝试使用 terraform 资源 azurerm_cosmosdb_account 和 azurerm_cosmosdb_mongo_database 在 Azure 中创建一个 MongoDB 类型的 cosmos 数据库。我们想选择免费套餐,但 terraform 似乎也不支持该套餐。有没有办法达到这个目的?

 resource "azurerm_resource_group" "rg" {
name = var.resource_group_name
location = var.location
}



resource "azurerm_cosmosdb_account" "db" {
name = var.cosmosdb_account
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
offer_type = "Standard"
kind = "MongoDB"

enable_automatic_failover = false

consistency_policy {
consistency_level = "Session"

}
capabilities {
name = "EnableMongo"
}

#geo_location {
# location = var.failover_location
# failover_priority = 1
# }

geo_location {
location = azurerm_resource_group.rg.location
failover_priority = 0
}

tags = var.tags
}

resource "azurerm_cosmosdb_mongo_database" "mongo-db" {
for_each = var.mongo-databases
name = each.value
resource_group_name = azurerm_resource_group.rg.name
account_name = azurerm_cosmosdb_account.db.name
throughput = 400
}

最佳答案

v2.20.0 起支持免费套餐AzureRM 提供商的信息(7 月 21 日发布...时间...)

请参阅documentation .

关于mongodb - Terraform 选择在 Azure 中使用免费层 cosmosDB 帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63010304/

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