2

目标是设置两个服务,一个Azure 函数应用程序和一个Cosmos DB。Cosmos DB 应该只允许来自函数应用的流量,并且函数应用应该使用 Cosmos DB 的密钥来访问它。

相关 Terraform 代码

resource "azurerm_cosmosdb_account" "cosmosdb_account" {
  ...
  ip_range_filter     = azurerm_function_app.function_app.possible_outbound_ip_addresses
}

resource "azurerm_function_app" "function_app" {
  ...
  app_settings = {
    key = azurerm_cosmosdb_account.cosmosdb_account.primary_master_key
  }
}

错误

Error: Cycle: azurerm_cosmosdb_account.cosmosdb_account, azurerm_function_app.function_app

没有 null_resources 或奇怪的黑客有什么方法可以做到这一点?

4

0 回答 0