You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Terraform设置Azure Cosmos DB账户的最低TLS版本

Azure Cosmos DB账户通过Terraform配置最低TLS版本的方案

当然有可行方案,Terraform的azurerm_cosmosdb_account资源支持通过minimum_tls_version参数直接配置最低TLS版本,不需要嵌套在子块中,示例代码如下:

resource "azurerm_cosmosdb_account" "example" {
  name                = "example-cosmosdb-account"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  offer_type          = "Standard"
  kind                = "GlobalDocumentDB"

  # 配置最低TLS版本
  minimum_tls_version = "1.2"

  consistency_policy {
    consistency_level       = "Session"
    max_interval_in_seconds = 5
    max_staleness_prefix    = 100
  }

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

需要注意:

  • 该参数支持的取值为"1.0"、"1.1"、"1.2",目前Azure推荐使用"1.2"
  • 这个参数是直接定义在azurerm_cosmosdb_account资源的根层级,而非像Web App那样嵌套在site_config子块中

内容的提问来源于stack exchange,提问作者The Fabio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 10:17:33