Recall & Review
beginner
What is the purpose of splitting Terraform configuration into multiple files?
Splitting Terraform configuration into multiple files helps organize code by function or resource type, making it easier to read, maintain, and collaborate on.
Click to reveal answer
beginner
What file typically contains the main Terraform resource definitions?
The
main.tf file usually contains the primary resource definitions and core infrastructure code.Click to reveal answer
beginner
What is the role of
variables.tf in Terraform projects?variables.tf defines input variables that allow users to customize the configuration without changing the code directly.Click to reveal answer
intermediate
Why should Terraform state files be kept separate from configuration files?
Terraform state files track the real-world infrastructure state and should be kept separate and secure to avoid accidental changes and to enable collaboration.
Click to reveal answer
beginner
How does using
outputs.tf help in Terraform projects?outputs.tf defines outputs that show important information after deployment, like IP addresses or resource IDs, making it easy to access key data.Click to reveal answer
Which file is best suited for defining Terraform input variables?
✗ Incorrect
variables.tf is used to declare input variables for customization.Where should you put resource definitions in a Terraform project?
✗ Incorrect
Resource definitions belong in
main.tf.What is the main reason to keep Terraform state files separate and secure?
✗ Incorrect
State files track infrastructure and must be protected to prevent errors.
Which file would you check to find the IP address of a deployed server?
✗ Incorrect
outputs.tf defines values like IP addresses to display after deployment.Why is it a good practice to organize Terraform files by purpose?
✗ Incorrect
Organizing files by purpose helps teams read and maintain code easily.
Explain how you would organize files in a Terraform project and why.
Think about separating code by function and protecting state.
You got /5 concepts.
Describe the role of Terraform state files and best practices for managing them.
State files are like a map of your deployed resources.
You got /5 concepts.