Recall & Review
beginner
What is the main purpose of a Terraform state file?
The Terraform state file keeps track of the resources Terraform manages. It records the current state of infrastructure so Terraform knows what exists and what changes to make.
Click to reveal answer
beginner
What format is the Terraform state file stored in?
Terraform state files are stored in JSON format. This makes it easy for Terraform and other tools to read and update the state.
Click to reveal answer
intermediate
Name two key sections you can find inside a Terraform state file.
Two key sections are: 1) "resources" which lists all managed resources and their attributes, and 2) "outputs" which stores output values from the configuration.
Click to reveal answer
intermediate
Why should you avoid manually editing the Terraform state file?
Manually editing the state file can cause inconsistencies and errors because Terraform relies on it to track real infrastructure. Mistakes can lead to resource loss or mismanagement.
Click to reveal answer
beginner
How does Terraform use the state file during the apply process?
Terraform compares the desired configuration with the state file to find differences. It then creates, updates, or deletes resources to match the desired state.
Click to reveal answer
What does the Terraform state file primarily store?
✗ Incorrect
The state file stores details about the current infrastructure resources Terraform manages.
In which format is the Terraform state file saved?
✗ Incorrect
Terraform state files are saved in JSON format.
Which section in the state file contains the list of managed resources?
✗ Incorrect
The "resources" section lists all managed infrastructure resources.
Why is it risky to manually edit the Terraform state file?
✗ Incorrect
Manual edits can cause Terraform to lose track of resources, leading to errors.
What does Terraform do with the state file during 'terraform apply'?
✗ Incorrect
Terraform compares the state file with the desired configuration to plan and apply changes.
Explain the purpose of the Terraform state file and why it is important.
Think about how Terraform remembers what it manages.
You got /4 concepts.
Describe the main parts of a Terraform state file and their roles.
Focus on what information Terraform stores about infrastructure.
You got /3 concepts.