0

从 terraform 创建 Azure VM:

  • azurerm_network_interface.nic[1]:发生 1 个错误:

  • azurerm_network_interface.nic.1:network.InterfacesClient#CreateOrUpdate:未能响应请求:StatusCode=400 -- 原始错误:autorest/azure:服务返回错误。Status=400 Code="RulesOfSameLoadBalancerTypeUseSameBackendPortProtocolAndIPConfig" Message="负载均衡器规则 /subscriptions/xxx/resourceGroups/dev/providers/Microsoft.Network/loadBalancers/webserver-lbip/inboundNatRules/RDP-VM0 和 /subscriptions/xxx/resourceGroups/dev/ providers/Microsoft.Network/loadBalancers/webserver-lbip/inboundNatRules/RDP-VM1 属于同一类型的负载均衡器并使用相同的后端端口3389和禁用浮动IP的协议Tcp,不得与相同的后端IP一起使用/订阅/xxx/resourceGroups/dev/providers/Microsoft.Network/networkInterfaces/NIC1/ipConfigurations/ipconfig1。” 详细信息=[]

地形:

resource "azurerm_network_interface" "nic" {
count = "${var.count}"
depends_on          = ["azurerm_virtual_network.network", "azurerm_lb.webserver-lbip"]
name                = "NIC${count.index}"
location            = "${azurerm_resource_group.rg.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"

ip_configuration {
    name                                    = "ipconfig1"
    subnet_id                               = "${azurerm_subnet.web.id}"
    private_ip_address_allocation           = "dynamic"
    load_balancer_backend_address_pools_ids = ["${azurerm_lb_backend_address_pool.webserver-lb-backend-pool.id}"]
    load_balancer_inbound_nat_rules_ids     = ["${azurerm_lb_nat_rule.webserver-nat1.id}", "${azurerm_lb_nat_rule.webserver-nat2.id}", "${azurerm_lb_nat_rule.webserver-nat3.id}", "${azurerm_lb_nat_rule.webserver-nat4.id}"]
}
}
4

0 回答 0