Terraform: 201-2-vms-internal-load-balancer


Kiran Patnayakuni   |   Co-authors:  Anusha DokulaVeeresh Setty

Create 2 Virtual Machines under an Internal Load balancer and configures Load Balancing rules for the VMs

Description

This is a conversion of ARM template 201-2-vms-internal-load-balancer  from the repository azure\azure-quickstart-templates  to Terraform configuration, and this configuration 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.

Syntax

# To initialize the configuration directory
PS C:\Terraform\201-2-vms-internal-load-balancer> terraform init 

# To check the execution plan
PS C:\Terraform\201-2-vms-internal-load-balancer> terraform plan

# To deploy the configuration
PS C:\Terraform\201-2-vms-internal-load-balancer> terraform apply

Example

PS C:\Terraform\201-2-vms-internal-load-balancer> terraform init 
PS C:\Terraform\201-2-vms-internal-load-balancer> terraform plan

var.adminPassword
Password for the Virtual Machine.
Enter a value: *********

<--- output truncated --->

PS C:\Terraform\201-2-vms-internal-load-balancer> terraform apply 

var.adminPassword
Password for the Virtual Machine.
Enter a value: *********

Output

azurerm_virtual_machine.avm01: Creating...
azurerm_virtual_machine.avm01: Still creating... [10s elapsed]

<--- output truncated --->

azurerm_virtual_machine.avm01[0]: Creation complete after 3m6s

Apply complete! Resources: 17 added, 0 changed, 0 destroyed.

Code

     View the code in GitHub  

Last modified: 4 August 2020

Share it on     |   |   |   | 
comments powered by Disqus