Recently I've had the need to spin up AD domain-based environment to test stuff. Sometimes it's specific tools, bypasses, or how configuration change affects particular parts in a domain.
Holding a full domain lab on a laptop\desktop is pretty cumbersome. You need resources for about 5-6 VMs running in parallel, and I couldn't do that on my laptop.
Besides, setting up this amount of machine plus all the needed configurations such as - setting up the domain, updating the machines, installing specific tools is a time-consuming process. Last, on top of everything - I'm lazy.
So I've decided to write code that I can use over and over that will do everything for me automatically:
- install all the needed machines - servers and clients
- configure all the environment stuff - domain, join to the domain, server roles
- install all the required essential software - browser, file editor and much more
- will save me time - deployment takes about ~45 minutes to be completed
- save me money - when finished, I need to run only one command to take everything down
I won't lie, it wasn't quick or easy to get all of that done. It was a project I've worked on for several weeks on & off. I've never used Terraform (or any other IaC) before. This was part of my learning process. I had my goals and needs in mind (and in writing). I've learned Terraform and used this project as my playground to test what I learned, think about what else I need, and eventually, I made something that suits my needs. (and probably have much more to learn…)
I might write down a more in-depth and technical post about the development process, what I learned and how in the future, but for now, feel free to visit the Disruption and try it out. And as always, if you have any feedback, please let me know.