Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

5.1. What Modules Are and How They're Sourced

💡 First Principle: A module is nothing more special than a directory of .tf files — your root configuration is already a module — so "using a module" just means pointing one configuration at another and feeding it inputs; the only real question is where that directory comes from.

Why care: Modules are the unit of reuse and sharing in Terraform. The exam tests the variety of valid sources (it's broader than the registry) and the addressing format for registry modules. Getting the source wrong is the most common reason terraform init fails to install a module.

The mental model: Think of a module like an installable package. You declare which package you want and from where (local folder, Git, registry), and init fetches it — exactly like a language's package manager pulling a dependency.

⚠️ Common Misconception: "Modules must come from the Terraform Registry." The registry is one convenient source, but modules can equally come from local paths, Git repositories, HTTP URLs, and cloud storage buckets. The source string tells Terraform which protocol to use.

Alvin Varughese
Written byAlvin Varughese
Founder18 professional certifications