Terraform
Terraform Module
Appears inTerraform Associate
A reusable set of Terraform resources grouped in a directory. The root module is the main working directory. Child modules are called from the root and can come from local sources, the Terraform Registry, or Git repositories.
On the exam
In Terraform Associate, modules are the way to reuse code. Input variables (variables.tf) and outputs (outputs.tf) define the module's interface. Question: how do you reuse the same VPC configuration across multiple environments? With a module.
Related terms
- Terraform VariableAn input parameter that lets you parameterize Terraform configurations. Declared with variable {} and assigned via a .tfvars file, environment variables (TF_VAR_), -var flags, or interactively.
- Terraform OutputA value exported after a terraform apply. Lets you expose resource attributes (IPs, URLs, IDs) for use in other modules or to display to the user. Declared with output {} in outputs.tf.