Overview - Root module concept
What is it?
In Terraform, a root module is the main folder or directory where you write your infrastructure code. It contains the configuration files that Terraform reads first to understand what resources to create or manage. This root module can call other modules, which are like smaller building blocks, but it always acts as the starting point. Think of it as the main blueprint for your cloud setup.
Why it matters
Without the root module, Terraform wouldn't know where to begin building or changing your cloud resources. It solves the problem of organizing complex infrastructure by providing a clear entry point. Without it, managing infrastructure would be chaotic, like trying to build a house without a main plan or foundation.
Where it fits
Before learning about root modules, you should understand basic Terraform concepts like resources and providers. After mastering root modules, you can learn about child modules, module composition, and how to organize large infrastructure projects efficiently.