protocol Tcp with floatingIP disabled, must not be used with the same backend IP

683 Views Asked by At

Creating Azure VM from terraform:

  • azurerm_network_interface.nic[1]: 1 error(s) occurred:

  • azurerm_network_interface.nic.1: network.InterfacesClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="RulesOfSameLoadBalancerTypeUseSameBackendPortProtocolAndIPConfig" Message="Load balancer rules /subscriptions/xxx/resourceGroups/dev/providers/Microsoft.Network/loadBalancers/webserver-lbip/inboundNatRules/RDP-VM0 and /subscriptions/xxx/resourceGroups/dev/providers/Microsoft.Network/loadBalancers/webserver-lbip/inboundNatRules/RDP-VM1 belong to the load balancer of the same type and use the same backend port 3389 and protocol Tcp with floatingIP disabled, must not be used with the same backend IP /subscriptions/xxx/resourceGroups/dev/providers/Microsoft.Network/networkInterfaces/NIC1/ipConfigurations/ipconfig1." Details=[]

Terraform:

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}"]
}
}
0

There are 0 best solutions below