0
0
Terraformcloud~5 mins

File naming conventions (.tf files) in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
Why should Terraform configuration files use the .tf extension?
Terraform recognizes files with the .tf extension as configuration files. This helps Terraform load and process them correctly when running commands.
Click to reveal answer
beginner
What is a good practice for naming Terraform files to keep configurations organized?
Use descriptive names that reflect the purpose, like network.tf for networking resources or variables.tf for variable definitions. This makes it easier to find and manage code.
Click to reveal answer
beginner
Can you use multiple .tf files in one Terraform project folder?
Yes. Terraform automatically loads all .tf files in a folder and combines them. This allows splitting configuration into smaller, manageable parts.
Click to reveal answer
intermediate
Should Terraform files be named with numbers or special characters for ordering?
No. Terraform does not require numbered or special character prefixes. It processes all files together regardless of name order. Use clear descriptive names instead.
Click to reveal answer
intermediate
What file extension is used for Terraform variable values and why?
Terraform uses .tfvars files to store variable values separately from configuration. This helps keep sensitive or environment-specific data organized and secure.
Click to reveal answer
Which file extension should Terraform configuration files have?
A.txt
B.json
C.tf
D.conf
How does Terraform handle multiple .tf files in the same folder?
AIt ignores files with similar names
BIt only loads the first file alphabetically
CIt requires files to be numbered to load
DIt loads and combines all .tf files automatically
What is a recommended naming style for Terraform files?
ADescriptive names like network.tf or variables.tf
BRandom numbers like 001.tf, 002.tf
CUsing spaces and special characters
DUsing uppercase extensions like .TF
Which file extension is used for storing Terraform variable values?
A.tfvars
B.tf
C.var
D.json
Is it necessary to number Terraform files to control their load order?
AYes, numbering controls load order
BNo, Terraform loads all files together regardless of name
COnly if files are in different folders
DYes, but only for .tfvars files
Explain why using descriptive file names for Terraform .tf files is important.
Think about how you find files on your computer.
You got /4 concepts.
    Describe how Terraform processes multiple .tf files in a project folder.
    Imagine putting puzzle pieces together.
    You got /4 concepts.