Root vs Child Modules
Last updated
What is Root vs Child Modules?
In Terraform, root and child modules refer to different levels of module hierarchy in a configuration. The root module is the main set of configuration files in the working directory where Terraform is executed. It's the entry point of your Terraform project and typically calls other modules. Child modules, on the other hand, are modules called by the root module or by other modules. They are reusable components that encapsulate specific resource configurations. Root modules define the overall architecture and compose child modules to create the complete infrastructure. Child modules focus on specific, repeatable tasks or resource groups. This hierarchy allows for better organization, reusability, and maintainability of Terraform code, enabling complex infrastructures to be broken down into manageable, modular components.
Free resources to learn Root vs Child Modules
- Official docsThe root module
- Official docsChild modules
- ArticleWhat is the difference between Terraform "Module" and "Child Module"
More in stage 14: Modules
Root vs Child Modules: common questions
Can I learn Root vs Child Modules in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Root vs Child Modules in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Root vs Child Modules tutorial for beginners?
It is lesson 54 of 110 in the free Terraform roadmap, in stage 14, Modules. If you are new to Terraform, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.