What are Terraform modules and why use them?
⚡
Quick Answer
Modules are reusable, parameterized groups of resources — the unit of composition and reuse.
Detailed Answer
A module bundles related resources with input variables and outputs, so you define (say) a VPC once and instantiate it per environment. Modules encapsulate complexity, enforce standards, and enable DRY infrastructure. Pin module versions from a registry for stability.
💡
Interview Tip
Pin module versions; expose a small, clear input surface.
terraformmodulesreuse