0
0
Terraformcloud~20 mins

Terraform show for state inspection - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Terraform State Inspector
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
1:30remaining
What does the command terraform show display?

You run terraform show after applying your configuration. What information will it display?

AA detailed summary of the current infrastructure state including resource attributes.
BThe syntax errors found in the Terraform configuration files.
CThe history of all previous Terraform apply operations.
DThe list of all Terraform commands available in the CLI.
Attempts:
2 left
💡 Hint

Think about what Terraform keeps after applying changes.

Configuration
intermediate
1:30remaining
Which command shows the Terraform state in JSON format?

You want to inspect the Terraform state programmatically. Which command will output the state in JSON format?

Aterraform output -json
Bterraform state list -json
Cterraform show -json
Dterraform plan -json
Attempts:
2 left
💡 Hint

Look for the command that shows state details in JSON.

Architecture
advanced
2:00remaining
What is the effect of running terraform show on a remote backend state?

You have configured Terraform to use a remote backend for state storage. What happens when you run terraform show?

ATerraform displays the backend configuration but not the state content.
BTerraform downloads the remote state and displays its content locally.
CTerraform fails because <code>terraform show</code> only works with local state files.
DTerraform shows only the local cached state without contacting the remote backend.
Attempts:
2 left
💡 Hint

Think about how Terraform accesses remote state when inspecting it.

security
advanced
2:00remaining
Which risk is associated with sharing the output of terraform show?

You share the output of terraform show with your team. What security risk might this pose?

AIt may expose sensitive data like passwords or API keys stored in the state.
BIt can cause Terraform to overwrite the remote state accidentally.
CIt allows unauthorized users to modify your infrastructure directly.
DIt reveals the Terraform CLI version used to create the state.
Attempts:
2 left
💡 Hint

Consider what kind of information the state file contains.

Best Practice
expert
2:30remaining
How should you inspect a specific resource's state attribute using Terraform CLI?

You want to see the current value of a specific resource attribute in the Terraform state. Which command and option combination is correct?

Aterraform output <resource_address>
Bterraform show -target=<resource_address>
Cterraform plan -refresh-only -target=<resource_address>
Dterraform state show <resource_address>
Attempts:
2 left
💡 Hint

Think about the command designed to show detailed info about one resource in state.