Recall & Review
beginner
What does the
terraform show command do?It displays the current state of your infrastructure as recorded in the Terraform state file. This helps you understand what resources exist and their configurations.
Click to reveal answer
beginner
How can you use
terraform show to inspect a specific state file?You can run
terraform show path/to/terraform.tfstate to view the details of a specific state file instead of the default one.Click to reveal answer
beginner
What is the benefit of inspecting the Terraform state with
terraform show?It helps you verify the actual deployed resources and their attributes, which is useful for debugging and understanding your infrastructure setup.
Click to reveal answer
intermediate
Can
terraform show output be formatted for easier reading?Yes, by default it outputs human-readable text, but you can use
terraform show -json to get a JSON formatted output for programmatic use.Click to reveal answer
intermediate
Why should you be careful when manually editing the Terraform state file instead of using
terraform show?Manual edits can corrupt the state and cause Terraform to lose track of resources, leading to errors or resource duplication.
terraform show is safe because it only reads the state.Click to reveal answer
What does
terraform show primarily display?✗ Incorrect
terraform show displays the current state of your infrastructure as recorded in the state file, including resource details.
How do you get a JSON output from
terraform show?✗ Incorrect
The correct flag is -json to get JSON formatted output.
Which file does
terraform show read by default?✗ Incorrect
By default, terraform show reads the terraform.tfstate file which holds the current state.
Why is it safer to use
terraform show instead of editing the state file directly?✗ Incorrect
terraform show only reads the state file and does not change it, preventing accidental corruption.
Which command lets you inspect a state file located in a custom path?
✗ Incorrect
You can specify the path to a state file directly with terraform show to inspect it.
Explain how
terraform show helps you understand your infrastructure state.Think about what information you get about your cloud resources from the state.
You got /4 concepts.
Describe the difference between using
terraform show and manually editing the Terraform state file.Consider safety and risk when changing the state file.
You got /4 concepts.