0
0
Terraformcloud~10 mins

Terraform output command - Interactive Code Practice

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

Complete the code to display the output values after applying Terraform.

Terraform
terraform [1]
Drag options to blanks, or click blank then click option'
Aapply
Binit
Coutput
Dplan
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'terraform apply' instead of 'terraform output' to see outputs.
Using 'terraform plan' which only shows changes but not outputs.
2fill in blank
medium

Complete the command to show a specific output named 'instance_ip'.

Terraform
terraform output [1]
Drag options to blanks, or click blank then click option'
A-json
Binstance_ip
C-state
D-refresh
Attempts:
3 left
💡 Hint
Common Mistakes
Using flags like '-json' instead of the output variable name.
Omitting the output name to get all outputs instead of one.
3fill in blank
hard

Fix the error in the command to output all values in JSON format.

Terraform
terraform output [1]
Drag options to blanks, or click blank then click option'
A-json
B-state=terraform.tfstate
C-refresh=false
D-var-file=prod.tfvars
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-state' or '-var-file' flags which do not affect output format.
Omitting the '-json' flag when JSON output is needed.
4fill in blank
hard

Fill both blanks to create a command that outputs the 'db_password' value in JSON format.

Terraform
terraform output [1] [2]
Drag options to blanks, or click blank then click option'
A-json
Bdb_password
C-state=terraform.tfstate
D-refresh=false
Attempts:
3 left
💡 Hint
Common Mistakes
Placing the output name before the flag.
Using unrelated flags like '-state' or '-refresh' here.
5fill in blank
hard

Fill all three blanks to output the 'app_url' value without refreshing state and in JSON format.

Terraform
terraform output [1] [2] [3]
Drag options to blanks, or click blank then click option'
A-refresh=false
B-json
Capp_url
D-state=terraform.tfstate
Attempts:
3 left
💡 Hint
Common Mistakes
Incorrect order of output name and flags.
Using unrelated flags like '-state' unnecessarily.