Creating Reusable Infrastructure with Terraform Modules in Azure

Lab Steps

lock
Creating Reusable Infrastructure with Terraform Modules in Azure

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyBeginner
Time Limit45m
Students37

Description

Modules are a critical component of production-grade Terraform configurations. It gives infrastructure developers the ability to split infrastructure services up into separate components. For example, you can have a module for deploying Virtual Machines and a module for Virtual Networks. You can then use each module as a building block for creating entire environments in Azure.

Terraform configuration files that are thousands of lines of code are considered an anti-pattern. Infrastructure code becomes unmanageable, and execution plans can take over 10 minutes to create. Instead, split the code up into modules. Modules separate pieces of the infrastructure into reusable, testable units.

Modules also provide a way for the community to share Terraform configurations with others. There are hundreds of modules on the Terraform Registry. It is highly recommended to look at the community-made modules before creating your own from scratch. The State of DevOps report shows that companies that re-use code are high performers.

In this lab, you will learn how to create reusable Terraform configurations using modules.

Learning Objectives

Upon completion of this lab you will be able to:

  • Understand how to use modules to create reusable infrastructure
  • Know the benefits of using modules
  • Learn how to pass data between modules

Intended Audience

This lab is intended for:

  • Individuals studying to take the HashiCorp Certified: Terraform Associate exam
  • Anyone interested in learning how to use Terraform to manage Cloud Service Providers

Lab Prerequisites

You should be familiar with:

  • Cloud Services
  • DevOps
  • Deploying resources with Terraform and using variables

The following course 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