Skip to content

Sample template that create two Linux VM and Azure Load Balancer using Terraform

Notifications You must be signed in to change notification settings

rodrigoffonseca/Azure-VM-LB-Terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Azure Load Balancer + Linux VM Terraform lab templates

Overview

In this hands-on lab, you will setup a virtual network with two linux VM that run Apache and publish a Web Site using Azure Load Balancer.

Network Architecture

TBD

Requirements

How to use the templates

  1. Download terraform files:

    • main.tf
    • variables.tf
    • terraform.tfvars

    In the Module-Version folder you will find the same Terraform templated with files divided by Azure Modules to make easier to you find what resource you need to create and how to do it.

  2. Edit main.tf file and change the following configuration:

  3. Edit terraform.tfvars file and change the following variable values:

    • location = Azure Region where you want to deploy
    • prefix = Prefix string that will be used for resource creation
    • adminname = Windows VM Local Admin Name
    • adminpwd = Windows VM Local Admin Password (must be complex and 12 char long)

You can use Azure Cloud Shell to execute your terraform template: https://shell.azure.com

  1. Initiliaze your terraform environment:

    terraform init

  2. Plan and review your terraform deployment:

    terraform plan

  3. Apply your terraform template (It takes at least 45 minutes to be complete):

    terraform apply

Test your lab deployment

  • Terraform will output the Website Public IP. You can use it to access the website and validate it works: http://XX.YY.WW.ZZ

Clean All Resources after the lab

After you have successfully completed the Azure Networking Terraform lab , you will want to delete the Resource Groups. Run following terraform command:

terraform destroy

About

Sample template that create two Linux VM and Azure Load Balancer using Terraform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages