This is a conversion of ARM template 101-loadbalancer-with-multivip from the repository azure\azure-quickstart-templates to Terraform configuration.
This configuration allows you to create a Load Balancer, 2 Public IP addresses for the Load balancer, Virtual Network, Network Interface in the Virtual Network. Each VIP is associated to a LB rule that is used by the Network Interface, and it will deploy the following resources…
Note:
If the specified resource group is already exist then the script will not continue with the deployment. If you want to deploy the resources to the existing resource group, then import the resource group to state before deployment.
# To initialize the configuration directory
PS C:\Terraform\101-loadbalancer-with-multivip> terraform init
# To check the execution plan
PS C:\Terraform\101-loadbalancer-with-multivip> terraform plan
# To deploy the configuration
PS C:\Terraform\101-loadbalancer-with-multivip> terraform apply
# Initialize
PS C:\Terraform\101-loadbalancer-with-multivip> terraform init
# Plan
PS C:\Terraform\101-loadbalancer-with-multivip> terraform plan
# Apply
PS C:\Terraform\101-loadbalancer-with-multivip> terraform apply
azurerm_resource_group.arg-01: Creating...
azurerm_resource_group.arg-01: Creation complete after 3s
azurerm_lb.alb-01: Still creating... [10s elapsed]
<--- output truncated --->
azurerm_lb_rule.albrule-01: Creation complete after 7s
Apply complete! Resources: 12 added, 0 changed, 0 destroyed