Module 🍟
Description
Modules are self-contained packages of Terraform configurations that are managed as a group. Modules allow you to organize your Terraform code and reuse it across multiple projects, making it easier to manage and maintain your infrastructure as code.
There are two types of Terraform modules:
-
Root modules: These are the main Terraform configurations that define your infrastructure. The root module is the top-level module in your Terraform configuration and it calls other Terraform modules as needed.
-
Child modules: These are Terraform modules that are called by the root module. Child modules encapsulate a portion of your infrastructure, making it easier to manage and maintain.
When you create a Terraform module, you can use inputs and outputs to define the expected input and output values of the module:
Inputs
allow you to pass parameters into the module, making it more flexible and reusable.Outputs
allow you to expose values from the module so that they can be used by other Terraform modules.