Get startedGet started for free

Module Overview

1. Module Overview

Welcome to Module 4: Organizing and Reusing Configuration with Terraform Modules. Abstracting and modularizing your code is a common practice In the programming world. As your infrastructure grows, so does your code base, and your team will have to spend a fair amount of time to understand the code, change it, test it, and then deploy it. The convenience that abstraction brings along with the flexibility to standardize code is undeniable. Developers commonly refer to the “Don’t Repeat Yourself” principle, also known as DRY. The idea of DRY is to avoid repeating the same set of code multiple times. In this module, we’ll explore how Terraform implements the DRY principle using modules. With modules, you can group sets of resources together so you can reuse them later. Should you have to update code, you’ll only need to do so in one location. This module explores use cases for modules and how to use them when writing your infrastructure code. We’ll start by describing a scenario in which modules play a critical role in building efficient code. Upon completion of this module, you’ll be able to define Terraform modules and use them to reuse configuration. To simplify the code writing process, you’ll learn how to use publicly available modules on Terraform or GitHub. You’ll also explore how to use input variables to parameterize configurations, and output values to access resource attributes outside the module. In addition, you’ll learn best practices for using modules, and examine how modules can be useful when working in different environments, such as development, testing, and production. You’ll conclude with a lab to apply the concepts that were covered. Ready? Let’s dive in!

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.