Updates to my Terraform Azure base Lab Environments

Earlier this year I blogged about some Lab Environments I’d created using Terraform, and shared in my GitHub repo:

“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.”

I’ve recently been working with Terraform more and more, with most of the focus on Azure – and thus the number of Lab Environments within my Repo has increased. In this post I wanted to provide an update on the environments available, and what they can be used for! Within each Lab there are a set of Terraform files, and instructions included to explain what is created and how to set the Lab up. The idea here is that labs can be deployed individually, or specific code sections can be used as required within your own deployments.

What is the Purpose of the Lab environments?

These lab environments are small deployments using Terraform within Azure. They are purely the output of some test environments and Labs I have been using for my own benefit – which I thought might be helpful to the community! Feel free to use/change/tweak/update them as you require! 🙂

Lab Environments – What is available?

At the current time, I have the following available within my GitHub repo:

1. Single Region Base Lab Environment for Azure

This code creates a simple Lab environment within a Single Azure Region. The idea here is that it allows for quick deployment of VNETs, Subnets, and a Domain Controller to simulate smaller environments or provide a quick lab for any test requirements. See: Single-Region-Azure-BaseLab

2. Dual Region Base Lab Environment for Azure

This code creates a simple Lab environment within two Azure Regions. The idea here is that it allows for quick deployment of VNETs, Subnets, and two Domain Controllers to simulate smaller environments or provide a quick lab for any test requirements. This environment is essentially the same as the Single Region Baselab, but with an additional Azure Region added. See: Dual-Region-Azure-BaseLab

3. Dual Region Base Lab Environment for Azure NetApp Files Cross Region Replication

This code is a replica of the Dual Region Azure BaseLab (item 2 above), but also includes the provision of Azure NetApp Files Accounts and Capacity Pools, so that Azure NetApp Files Cross Region Replication can be evaluated. See: Dual-Region-Azure-BaseLab-For-Azure-NetApp-Files-CRR

4. Single Region Base Lab Environment for Azure – with Ansible VM

This code creates a simple Lab environment within a Single Azure Region (it’s the same as the Single Region Baselab), and also includes an Ubuntu VM with Ansible installed. The idea here is that it allows for quick deployment of VNETs, Subnets, and a Domain Controller to simulate smaller environments or provide a quick lab for any test requirements, and also to provide Ansible capability within the environment. See: Single-Region-Azure-BaseLab-with-Ansible

5. Azure Firewall Demo Lab

This code creates a simple Lab environment within a Single Azure Region (it’s the same as the Single Region Baselab), and also includes an additional Subnet, and an Azure Firewall deployment. To start testing Azure Firewall a blank policy is also created. All that’s required to start sending traffic out through the firewall is to add a route table to the desired Subnet. See: Azure-Firewall-DemoLab

6. Ansible quick start Lab

This code creates a simple Azure Environment with an Ubuntu Server VM, and uses a Custom Script Extension to install Ansible. You can then use Ansible as you require. See Ansible-Quickstart

7. Automatic NSG based on the Client IP of the Machine running Terraform

This creates a data item that gets the external IP of the machine that is running Terraform. The IP is then used to create an inbound security rule inside a Network Security Group within Azure. This can be used to secure Lab Environments – so you can safely use Public IP addresses with Lab VMs and restrict access to your own external IP address. See: Automatic-ClientIP-NSG

8. Azure KeyVault with Secret for Virtual Machine Password

This creates an Azure Key Vault using a random name like “keyvault##########”, and then creates a password string, using the random_string resource, which is stored inside the KeyVault. This can then be used during the setup of VMs with Terraform. See: Azure-KeyVault-with-Secret

How do I deploy these?

Simply download a copy of the lab files, or fork the repo, and then deploy the lab that you require using Terraform. Finally, you’ll need to follow the quick Manual Steps in the instructions, as some labs have some additional steps required to complete the setup. (These instructions are included in the GitHub readme files!).

If you are unfamiliar with Terraform deployments into Azure – I would recommend the following links and blogs to help you get started:

As always – any feedback is welcomed, or recommendations for any enhancements, and other Lab Environments that would be useful! Please feel free to reach out! 🙂