0
0
Terraformcloud~10 mins

Terraform show for state inspection - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to display the current Terraform state in a human-readable format.

Terraform
terraform [1]
Drag options to blanks, or click blank then click option'
Ashow
Bapply
Cinit
Dplan
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'terraform apply' instead of 'terraform show'.
Confusing 'terraform plan' with 'terraform show'.
2fill in blank
medium

Complete the command to show the Terraform state from a specific state file named 'prod.tfstate'.

Terraform
terraform show [1]
Drag options to blanks, or click blank then click option'
A-json
B-refresh=false
C-input=false
D-state=prod.tfstate
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-json' instead of '-state' to specify the file.
Omitting the state file option when multiple state files exist.
3fill in blank
hard

Fix the error in the command to output the Terraform state in JSON format.

Terraform
terraform show [1]
Drag options to blanks, or click blank then click option'
A-output=json
B-state-json
C-json
D-format json
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-state-json' which is not a valid flag.
Using '-output=json' which is incorrect syntax.
4fill in blank
hard

Fill both blanks to show the Terraform state in JSON format from a specific file named 'dev.tfstate'.

Terraform
terraform show [1] [2]
Drag options to blanks, or click blank then click option'
A-json
B-state=dev.tfstate
C-state=prod.tfstate
D-refresh=false
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of the flags.
Using the wrong state file name.
5fill in blank
hard

Fill all three blanks to show the Terraform state in JSON format from the state file 'terraform.tfstate' without refreshing.

Terraform
terraform show [1] [2] [3]
Drag options to blanks, or click blank then click option'
A-json
B-state=terraform.tfstate
C-state-out=staging.tfstate
D-refresh=false
Attempts:
3 left
💡 Hint
Common Mistakes
Using -state-out=staging.tfstate which writes output to a file.
Forgetting to disable refresh when inspecting without provider calls.