Passing Outputs Between Terraform Modules with Terragrunt in Azure

Lab Steps

lock
Passing Outputs Between Terraform Modules with Terragrunt in Azure

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyAdvanced
Time Limit40m
Students23
Ratings
5/5
starstarstarstarstar

Description

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.

Learning Objectives

Upon completion of this lab you will be able to:

  • Understand how to deploy Terraform resources with Terragrunt
  • Learn how to pass data between modules using Terragrunt
  • Understand the concept of reducing the blast radius with separate Terraform states

Intended Audience

This lab is intended for:

  • Individuals familiar with using Terraform and how to deploy resources
  • Anyone interested in learning how to use Terragrunt to increase Terraform effectiveness
  • Enterprises looking to scale their Terraform codebase

Lab Prerequisites

You should be familiar with:

  • Cloud Services
  • DevOps
  • Basic understanding of Terraform modules and variables
  • Basic understanding of Terragrunt and keeping remote state DRY

The following course and lab can be used to fulfill the prerequisites:

Environment before
PREVIEW
arrow_forward
Environment after
PREVIEW
About the Author
Students2899
Labs42
Courses1
Learning paths3

Luke currently serves as a Cloud Labs Developer at Cloud Academy. His background is infrastructure development using Terraform. He is an Azure DevOps Engineer Expert, Azure Administrator Associate, and HashiCorp Certified - Terraform Associate.

Covered Topics