gpt4 book ai didi

azure - Terraform 错误 : Cycle: azurerm_subnet_service_endpoint_storage_policy. stg

转载 作者:行者123 更新时间:2023-12-03 00:21:18 25 4
gpt4 key购买 nike

无法将 service_endpoint_policy_ids 附加到子网

service_endpoints 创建成功,但存储策略无法附加到子网

最终出现以下错误

Error: Cycle: azurerm_subnet_service_endpoint_storage_policy.stg, azurerm_subnet.backend, module.storage_bsai.var.vnet_subnet_id (expand), module.storage_bsai.azurerm_storage_account.storageaccount_name, module.storage_bsai.output.id (expand)

提供商azurerm 版本 =“2.65.0”

存储策略和子网的 Terraform 资源

  resource "azurerm_subnet_service_endpoint_storage_policy" "stg" {
name = "storage-policy-bsai"
resource_group_name = "${var.env}-bsai"
location = var.region
definition {
name = "storage"
#description = "definition1"
service_resources = [
module.resource_group.id,
module.storage_bsai.id
]
}
}
resource "azurerm_subnet" "backend" {
depends_on = [module.vnet]
name = "backend"
virtual_network_name = "${var.env}-${var.region}-bsai"
resource_group_name = "${var.env}-bsai"
address_prefixes = ["10.0.0.0/24"]
service_endpoints = ["Microsoft.Storage", "Microsoft.AzureCosmosDB", "Microsoft.ServiceBus", "Microsoft.Web", "Microsoft.ContainerRegistry"]
service_endpoint_policy_ids = [azurerm_subnet_service_endpoint_storage_policy.stg.id]
delegation {
name = "delegation"
service_delegation {
name = "Microsoft.Web/serverFarms"
actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
}
}
}

最佳答案

service_endpoint_policy_ids 应该是一个列表:

service_endpoint_policy_ids = [azurerm_subnet_service_endpoint_storage_policy.stg.id[

关于azure - Terraform 错误 : Cycle: azurerm_subnet_service_endpoint_storage_policy. stg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68384026/

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