Recall & Review
beginner
What does the
terraform state pull command do?It downloads the current Terraform state file from the remote backend and outputs it locally. This lets you see the exact state Terraform is tracking.
Click to reveal answer
beginner
What is the purpose of
terraform state push?It uploads a local Terraform state file to the remote backend, replacing the existing state. This is useful to fix or update the remote state manually.
Click to reveal answer
intermediate
Why should you be careful when using
terraform state push?Because it overwrites the remote state file, which can cause conflicts or loss of changes if done incorrectly. Always ensure the state file is valid and up to date.
Click to reveal answer
beginner
How does Terraform use the state file during deployments?
Terraform uses the state file to track resources it manages. It compares the state to your configuration to know what to create, update, or delete.
Click to reveal answer
intermediate
When might you need to manually pull and push Terraform state?
When fixing state corruption, migrating state between backends, or recovering from errors where the remote state is out of sync with local files.
Click to reveal answer
What does
terraform state pull do?✗ Incorrect
terraform state pull downloads the remote state file so you can view or save it locally.Which command uploads a local state file to the remote backend?
✗ Incorrect
terraform state push uploads your local state file to replace the remote state.Why should you avoid frequent use of
terraform state push?✗ Incorrect
Pushing state overwrites remote state and can cause conflicts or loss if not done carefully.
What is stored inside the Terraform state file?
✗ Incorrect
The state file stores metadata about resources Terraform manages and their current status.
When is it appropriate to manually pull and push Terraform state?
✗ Incorrect
Manual pull and push are used for recovery or migration, not routine operations.
Explain the roles of
terraform state pull and terraform state push in managing Terraform state.Think about how Terraform keeps track of resources remotely and locally.
You got /4 concepts.
Describe why careful handling of Terraform state files is important during infrastructure management.
Consider what happens if Terraform's view of resources is wrong.
You got /4 concepts.