Recall & Review
beginner
What is the purpose of state in Terraform?
State keeps track of the resources Terraform manages. It helps Terraform know what exists, what changed, and what to create or delete.
Click to reveal answer
beginner
How does Terraform use state to plan changes?
Terraform compares the current state with the desired configuration to decide what actions to take, like adding or removing resources.
Click to reveal answer
intermediate
Why is it important to keep Terraform state secure and consistent?
Because state contains sensitive info and is the source of truth. If lost or corrupted, Terraform can’t manage resources correctly.
Click to reveal answer
intermediate
What happens if Terraform state is out of sync with real infrastructure?
Terraform may try to recreate or delete resources incorrectly, causing errors or downtime.
Click to reveal answer
intermediate
How can teams safely share Terraform state?
By using remote state backends like cloud storage with locking to prevent conflicts and keep state updated for everyone.
Click to reveal answer
What does Terraform state primarily store?
✗ Incorrect
Terraform state stores details about the infrastructure resources it manages to track their current status.
Why is Terraform state important during the 'terraform plan' step?
✗ Incorrect
Terraform uses state to compare current resources with desired ones and plan changes accordingly.
What risk occurs if Terraform state is lost or corrupted?
✗ Incorrect
Losing state means Terraform can’t track resources, leading to potential mismanagement.
How can teams avoid conflicts when multiple people use Terraform?
✗ Incorrect
Remote state with locking prevents simultaneous changes that cause conflicts.
Which of these is NOT stored in Terraform state?
✗ Incorrect
Resource configuration code is in Terraform files, not in the state.
Explain why Terraform state is essential for managing infrastructure.
Think about how Terraform knows what exists and what to change.
You got /4 concepts.
Describe best practices for handling Terraform state in a team environment.
Consider how to keep state consistent and safe when many people work together.
You got /4 concepts.