Overview - Module structure and conventions
What is it?
A Terraform module is a folder with files that define infrastructure resources and configurations. It groups related resources so you can reuse and organize your infrastructure code easily. Modules have a standard structure with specific files for inputs, outputs, and main configuration. This helps teams build consistent and manageable infrastructure setups.
Why it matters
Without modules, infrastructure code becomes messy and repetitive, making it hard to maintain or update. Modules solve this by letting you write code once and reuse it many times, saving time and reducing mistakes. They also help teams share best practices and keep infrastructure reliable and consistent.
Where it fits
Before learning modules, you should understand basic Terraform concepts like resources, variables, and outputs. After modules, you can explore advanced topics like module composition, versioning, and publishing modules to registries.