As Terraform projects start to scale in size, it's critical to split up infrastructure components into separate Terraform state files. This greatly reduces the blast radius for changes made to the infrastructure. This strategy is a popular concept within the Terraform community and is also referred to as "Terraservices." The infrastructure that frequently changes like Virtual Machines, ACI, or AKS services should stay separate from infrastructure that rarely changes, like Resource Group configurations. Also, sensitive services like SQL should have their own state file. You don't want to be resizing a Virtual Machine in the same Terraform configuration that contains code for the SQL database. Splitting up components can become very hard to manage with Terraform alone, which is why Terragrunt becomes an important tool when managing infrastructure that has been split up into Terraservices.
In this lab, you will use Terragrunt to split up an environment into separate states and pass data between each component.
Upon completion of this lab you will be able to:
This lab is intended for:
You should be familiar with:
The following course and lab can be used to fulfill the prerequisites:
June 24th, 2021 - Updated VM Size for the lab to increase resource allocation
Luke is a Site Reliability Engineer at Microsoft. His background is infrastructure development using Terraform and in 2021 he was awarded the HashiCorp Ambassador award. He is an Azure DevOps Engineer Expert, Azure Administrator Associate, and HashiCorp Certified - Terraform Associate.