从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和协议Tcp且禁用floatingIP,不得与同一后端IP /使用订阅/ XXX / resourceGroups的/ dev /提供商/ Microsoft.Network / networkInterfaces / NIC1 / ipConfigurations / ipconfig1“。详细= []
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}"]
}
}