0
0
Terraformcloud~5 mins

Root module concept in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the root module in Terraform?
The root module is the main folder where you run Terraform commands. It contains the primary configuration files that define your infrastructure.
Click to reveal answer
beginner
How does Terraform find the root module?
Terraform looks in the current working directory where you run the commands. This directory is the root module.
Click to reveal answer
intermediate
Can the root module call other modules?
Yes, the root module can include other modules to organize and reuse infrastructure code.
Click to reveal answer
beginner
Why is the root module important in Terraform?
It acts like the main blueprint for your infrastructure. All Terraform commands start here, and it controls how other modules fit together.
Click to reveal answer
beginner
What files are typically found in the root module?
Files like main.tf, variables.tf, outputs.tf, and terraform.tfstate are usually in the root module folder.
Click to reveal answer
Where does Terraform look for the root module?
AIn the current working directory
BIn the cloud provider's console
CIn a hidden system folder
DIn the user's home directory
What is the main role of the root module?
ATo define the main infrastructure configuration
BTo store Terraform state files only
CTo manage cloud provider credentials
DTo run Terraform commands remotely
Can the root module include other modules?
AOnly if they are in the same folder
BNo, modules are separate and cannot be linked
CYes, to organize and reuse code
DOnly if they are from the Terraform registry
Which file is NOT typically part of the root module?
Amain.tf
Bindex.html
Cvariables.tf
Doutputs.tf
What happens if you run Terraform commands outside the root module directory?
ATerraform will automatically find the root module elsewhere
BTerraform will run but ignore all modules
CTerraform will create a new root module automatically
DTerraform will fail because it can't find configuration files
Explain what the root module is and why it is important in Terraform.
Think of the root module as the main folder where Terraform looks first.
You got /3 concepts.
    Describe how the root module interacts with other modules in a Terraform project.
    Consider the root module as the main blueprint that includes smaller blueprints.
    You got /3 concepts.