As you may know, I maintain a range of Terraform environments for Azure, which can be used for Demos, Labs, Learning and Testing. These are maintained within my GitHub Repo, and I have occasionally also blogged about updates to these environments: https://jakewalsh.co.uk/updates-to-my-terraform-azure-base-lab-environments/.
✅ Just want the Code or Module? Click here: Code / Module
Overview:
I’ve recently been updating one of the most used environments within this Repo – the Single Region Azure BaseLab.
✅ This is designed to provide A simple Azure Lab for Testing/Learning/Demos, that contains the following Resources:
- 2 Virtual Networks, A Hub and Spoke with Subnets (For Gateway, Firewall, and Bastion Services in the Hub, and for general use in the Spoke).
- Azure Key Vault.
- A Single Virtual Machine, with a Data Disk (for use as a Domain Controller).
- A Public IP, assigned to the above Virtual Machine.
- An NSG that allows only your Client IP to RDP into the Virtual Machine.
- A randomly generated password for the Virtual Machine that is stored in the Key Vault.
Whilst the Single Region Azure BaseLab has proven useful, and seen widespread use – it is time for an update! ✅
Introducing – Single Region Azure BaseLab V2!
I decided I would update the Single Region Azure BaseLab to a V2 version, mostly due to the fact that there have been numerous changes to Azure and best practise since it was created, but also, my own Terraform skills have improved – and there are many new aspects I wanted to bring into the environment. A summary of the key changes is outlined below:
Lab Changes/Improvements:
- Terraform Variables reduced from around 22 individual variables, to 11.
- Lab Files split out between Core and Optional files.
- CIDRSubnet function used to calculate network ranges – rather than lots of static variables.
- Terraform Provider updated to latest version (I also maintain these – keeping them up to date within my repo monthly).
- Updated naming, based on Regional aspects.
New Features/Capabilities:
- Resource Groups split across functionality – rather than a single Resource Group.
- Virtual Machines deployed into an Availability set.
- Virtual Machine quantity controllable via a variable (1 is the minimum).
- Optional Features added – which can be controlled via a true/false variable:
- Azure Bastion
- Azure Firewall
- Virtual Network Gateway
- AVD Supporting Elements (Host Pools, Application Groups, Workspaces)
- Code now available in both flat files, and as a module.
Lab Diagram:
✅ Note – anything surrounded by a dashed red box above, is an optional feature within the lab!
How do I download and use the Lab?
Getting the lab is easy, you can either download the flat Terraform Files, or you can use a Module I have created. Both are hosted within my GitHub Account:
Using the Lab is also very simple, and follows the same conventions as any of the other Terraform environments or modules that I have created. If you wish to get started using Terraform, or need a guide for deployment – please check out my “Terraform Getting Started” blog series, where I have written up the entire process. ✅
What about using the Optional Features?
Using Optional Features in the lab is simple – just set the variables to “true” or “false” based on your requirements:
Conclusion
Whilst this environment is not intended for any production use – it hopefully forms a useful starting point for Demos, Labs, Learning, Testing and more. If you encounter any issues using the environment, or have suggestions for future improvements or adjustments, please feel free to reach out via Twitter, my Contact Form, or open an issue within GitHub.