Introducing my Terraform Azure base Lab Environments

Recently I have been working more and more with Terraform – and seeing the benefits to what I can do in a short space of time within Azure, using Infrastructure as Code (IaC) methodologies. I’m now using Terraform for all my Azure lab needs – it’s so fast and easy to deploy just what I need, and tweak from there or test new features/requirements out. The speed and ease of deployment means I often spin up a brand new lab environment whenever I need to. These lab environments take around 10 minutes to deploy. 

To make things easy for myself – I have two Azure Lab environments ready to go. Both are almost identical – the only difference is the addition of a second region in the dual region lab. (The name does sort of give that away!) I’ve made them both available in my GitHub Repo, but wanted to detail out the environments here too!

What does the Lab look like?

An overview of the Dual Region base lab is shown below – the Single Region one just doesn’t have anything shown in Region 2!

What is in the Lab Environments?

Each Lab contains the following items:

  • Resource Groups for Infrastructure (per Region) and Security elements.
  • A Hub and Spoke VNET topology.
  • Three subnets per VNET, with a Subnet delegated to Azure NetApp Files in the Spoke VNET.
  • An NSG attached to all Lab Subnets that uses the Automatic NSG Rule (to allow inbound RDP) I blogged about.
  • An Azure Key Vault with a random name, and a random secure password that is used later on when creating VMs.
  • Public IPs for all the created VMs in the Lab (to allow easy Lab access).
  • Network Interfaces for the created VMs.
  • Data Disk for the VMs (for NTDS storage) – with caching off.
  • Windows 2019 VM to act as a Domain Controller (1 per Region).
  • Custom Script Extension that sets up the required roles for Domain Controller operation, and installs a few useful apps using Chocolatey.
  • PowerShell scripts to complete the Domain Controller setup (which are automatically downloaded and placed in C:\BaselabSetup), so getting the lab up and running is easy!

How do I deploy these?

Simply clone or download a copy of the files in my GitHub repository and then deploy either the single or dual region lab, and follow the quick Manual Steps in the instructions, to complete the Active Directory setup – then you’re good to go!

As always – any feedback is welcomed, or recommendations for any enhancements that would be useful, please feel free to reach out! 🙂