Infrastructure · Flashcard

Every Terraform configuration already contains one module. Which?

  • AThe root module, the directory the commands are run in
  • BThe default module, created implicitly by terraform init
  • CThe main module, named after the main.tf file it contains
  • DNone — a directory becomes a module only when it is called

Why this is the answer

The working directory is the root module, and every module block it contains adds a child module; that is why 'module' is a directory of .tf files rather than a special construct. File names such as main.tf are pure convention — Terraform loads every .tf file in the directory.

Official docs
Study in Gnoseed →