Skip to content

Commit

Permalink
Fix load-balancer example with new syntax for v2.0 (#6836)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragz committed May 9, 2020
1 parent a177e53 commit b2bc8ea
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -109,11 +109,18 @@ resource "azurerm_network_interface" "nic" {
name = "ipconfig${count.index}"
subnet_id = "${azurerm_subnet.subnet.id}"
private_ip_address_allocation = "Dynamic"
load_balancer_backend_address_pools_ids = ["${azurerm_lb_backend_address_pool.backend_pool.id}"]
load_balancer_inbound_nat_rules_ids = ["${element(azurerm_lb_nat_rule.tcp.*.id, count.index)}"]
}
}


resource "azurerm_network_interface_nat_rule_association" "natrule" {
network_interface_id = "element(azurerm_network_interface.nic.*.id, count.index)"
ip_configuration_name = "ipconfig${count.index}"
nat_rule_id = "element(azurerm_lb_nat_rule.tcp.*.id, count.index)"
count = 2
}


resource "azurerm_virtual_machine" "vm" {
name = "vm${count.index}"
location = "${var.location}"
Expand Down

0 comments on commit b2bc8ea

Please sign in to comment.