Practice Terraform module vocabulary: module registry publishing, version pinning, input variables, module outputs, and root module composition patterns.
0 / 5 completed
1 / 5
'We published the VPC module to the internal registry.' What is a Terraform module registry?
A Terraform module registry is a service for hosting and versioning reusable modules. The public Terraform Registry (registry.terraform.io) hosts community modules. Organisations often run private registries (via Terraform Cloud/Enterprise, GitLab, or custom tools) to share internal modules. Publishing a module makes it available to all teams via a standard source reference.
2 / 5
'Module version pinning.' Why is it important to pin module versions?
Version pinning (e.g., version = '2.3.1') ensures your Terraform configuration always uses the same module version regardless of when or where it runs. Without pinning, a new module version could introduce breaking changes silently. Best practice: pin to a specific version in all environments, and explicitly update the pin after reviewing the changelog.
3 / 5
'The module exposes these input variables.' What are Terraform module input variables?
Input variables are a module's public interface. They define what the consumer can or must configure. Required variables (no default) must be provided; optional variables have defaults. Well-designed modules expose only the inputs needed for customisation and hide internal implementation details. Input variables are defined in variables.tf and referenced as var.name within the module.
4 / 5
'The module outputs the VPC ID and subnet IDs.' What are module outputs used for?
Module outputs are the module's way of sharing data with its caller. If a VPC module creates a VPC and subnets, it outputs their IDs so the calling code can reference them (e.g., module.vpc.vpc_id). Without outputs, the calling code would have no way to use resources created inside the module. Outputs are defined in outputs.tf within the module.
5 / 5
'The root module calls the VPC and EKS modules.' What is the root module in Terraform?
The root module is the top-level Terraform configuration — the .tf files in the directory where you run terraform plan and apply. It's the orchestration layer that calls child modules (like VPC, EKS, RDS modules) and wires them together. The root module may also define resources directly. Every Terraform project has exactly one root module; all other modules are child modules called from it.