Terraform module for Azure VNet.
This creates an Azure virtual network and a number of subnets, as specified by the provided variables. Examine variables.tf to understand the variable structure; variables.tfvars for example values.
This module requires that the following are installed locally:
It also requires that there is an existing Azure Resource Group into which to place the VNet components.
docker run -it -v $HOME/.azure:/root/.azure mcr.microsoft.com/azure-cli az login
# set the values below to reflect the resource group and remote storage
export TF_VAR_resource_group_name=
export TF_VAR_storage_account_name=
export TF_VAR_container_name=
# initialise terraform
terraform init \
-backend-config "resource_group_name=$TF_VAR_resource_group_name" \
-backend-config "storage_account_name=$TF_VAR_storage_account_name" \
-backend-config "container_name=$TF_VAR_container_name"
# create a terraform plan file from the provided variables
# NOTE: the existing Azure resource group will need to be provided at the command-line, or manually added to the tfvars file
terraform plan -var-file="variables.tfvars" -out tfplan
# apply the plan, creating the Azure VNet resources
terraform apply "tfplan"
terraform destroy -var-file="variables.tfvars"
This project is licenced under the terms of the Apache 2.0 License licence.