Module: a folder of .tf files you can call repeatedly with different variables. It encapsulates a logical component (e.g., a VPC) so teams reuse vetted infrastructure rather than copy-pasting.
2 / 5
What are module input variables used for?
Input variables: declared with variable blocks, they let callers customize a module (region, instance size, names). This is what makes a module reusable across environments.
3 / 5
What does a module output value do?
Output value: declared with output, it surfaces internal attributes (e.g., a created subnet ID) so the parent configuration or other modules can consume them.
4 / 5
What is the benefit of versioning a module from a registry?
Module versioning: referencing version = "~> 2.0" from a registry locks the module so a new release does not unexpectedly alter your infrastructure. Upgrades become a deliberate, reviewable step.
5 / 5
What is a root module versus a child module?
Root vs child: the root module is the entry point where you run terraform apply. Any module it invokes via a module block is a child. Children can call further children, forming a tree.