如何使用 terraform 创建 Azure Cosmos DB for PostgreSQL 集群

2023-12-28

我想创建一个适用于 PostgreSQL 集群的 Azure Cosmos DB。地形资源提供者azurerm有资源azurerm_cosmosdb_account这似乎没有反映 Azure Web 基础向导的属性(例如PostgreSQL 版本 or Scale地形中缺失)

我执行了以下操作,但没有成功,因为请求的资源类型对于我的位置的配额为零。如果我通过web创建集群就不会出现这个错误。

resource "azurerm_cosmosdb_account" "main" {
  name                = "cospos-main"
  location            = data.azurerm_resource_group.main.location
  resource_group_name = data.azurerm_resource_group.main.name
  offer_type          = "Standard"
  kind                = "Parse"

  enable_free_tier              = true
  enable_automatic_failover     = false
  public_network_access_enabled = false

  consistency_policy {
    consistency_level = "Strong"
  }

  geo_location {
    location          = data.azurerm_resource_group.main.location
    failover_priority = 0
  }
}

resource "azurerm_cosmosdb_sql_database" "db" {
  name                = "sqldb-db"
  resource_group_name = azurerm_cosmosdb_account.main.resource_group_name
  account_name        = azurerm_cosmosdb_account.main.name

  autoscale_settings {
    max_throughput = 1000
  }
}

错误信息提示我创建时在 Web 控制台中获得的配额Azure Database for PostgreSQL 灵活服务器.

{\"code\":\"ServiceUnavailable\",\"message\":\"Sorry, we are currently experiencing high demand in Germany West Central region, and cannot fulfill your request at this time Tue, 22 Nov 2022 11:26:12 GMT. To request region access for your subscription, please follow this link https://aka.ms/cosmosdbquota for more details on how to create a region access request."}

我可以手动创建 Cosmos DB 集群。

的值kindand consistency_level几乎是一个猜测文档 https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cosmosdb_account并没有真正启发我。

关于如何使用 terraform 创建集群有任何提示吗?


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 terraform 创建 Azure Cosmos DB for PostgreSQL 集群 的相关文章

随机推荐