Skip to content
Captain's Academy0
← Terraform sea chart
Island 2 · HCL basics · Port 2.4

File layout

Ask the Captain
Instagram
Does Terraform care what you name your files?
You'll learn to

lay out a root module (main, variables, outputs, providers, terraform.tfvars) knowing every .tf in a folder is one configuration

Recap

  1. 1Every .tf file in the folder = one configuration. Names and order don't matter
  2. 2Style guide names: terraform.tf, providers.tf, main.tf, variables.tf, outputs.tf
  3. 3Subfolders are not read: they're modules. Commit the lock file, never the state
Check yourself

You put network.tf in a subfolder. What happens when you run plan in the parent folder?

2.4

Stamp this lesson

Watched it and passed the check? Mark it in your logbook.