Interview Prep/Terraform/IaC and Terraform Fundamentals

Which files make up a typical Terraform root module?

BeginnerConceptIaC and Terraform Fundamentals
Answer

Terraform loads every .tf file in the working directory as one module, so file names are convention only. We usually split into main.tf (resources), variables.tf, outputs.tf, providers.tf or versions.tf (the terraform block and providers), locals.tf, and terraform.tfvars for values. Subdirectories are not loaded unless called as modules.

All Terraform questions Roadmap: Terraform

More on IaC and Terraform Fundamentals