A Terraform configuration consists of a root module, where evaluation begins, along with a tree of child modules created when one module calls another.
The main purpose of the Terraform language is declaring resources. All other language features exist only to make the definition of resources more flexible and convenient.
A group of resources can be gathered into a module, which creates a larger unit of configuration. A resource describes a single infrastructure object, while a module might describe a set of objects and the necessary relationships between them in order to create a higher-level system.
So, in one terraform root folder there could be many modules folder which are called by root module.
— — — — main terraform folder
— — — — — — — — -build
— — — — — — — — — — -main.tf, auth.tf,
— — — — — — — — -test
— — — — — — — — — — main.tf, auth.tf
— — — — — — — — -production
— — — — — — — — — — -main.tf,auth.tf
— — — — — — — — -Modules
— — — — — — — — — — -ebs,sg,vpc
So, you got the idea that main.tf could be inside one folder but can call anywhere, even github address.