Recall & Review
beginner
What is the purpose of an output declaration in Terraform?
An output declaration in Terraform shows important information after applying the configuration, like IP addresses or resource IDs, so you can use or see them easily.
Click to reveal answer
beginner
Basic syntax of a Terraform output declaration?
Use the keyword
output followed by a name without quotes, then a block with value = and the expression to output.<br>Example:<br>output "example" {
value = aws_instance.myserver.id
}Click to reveal answer
intermediate
Can Terraform outputs have descriptions? Why use them?
Yes, outputs can have a
description field to explain what the output means. This helps others understand the purpose of the output when reading the Terraform plan or state.Click to reveal answer
intermediate
How do you mark an output as sensitive in Terraform?
Add
sensitive = true inside the output block to hide the output value from normal display, protecting secrets or private data.Click to reveal answer
beginner
What happens if you omit the
value in an output declaration?Terraform requires the
value field in an output block. Omitting it causes an error because Terraform doesn't know what to show as output.Click to reveal answer
Which keyword starts an output declaration in Terraform?
✗ Incorrect
The
output keyword is used to declare outputs in Terraform.How do you hide sensitive output values in Terraform?
✗ Incorrect
Setting
sensitive = true hides the output value from normal display.What must every Terraform output block include?
✗ Incorrect
The
value field is required to specify what the output shows.What is the correct way to reference an AWS instance ID in an output?
✗ Incorrect
The correct syntax is
aws_instance.myserver.id to get the ID attribute.Why add a description to an output?
✗ Incorrect
Descriptions help users understand the purpose of the output.
Write the syntax for a Terraform output that shows the public IP of a server and includes a description.
Start with output, give it a name, add value and description inside curly braces.
You got /5 concepts.
Explain how to protect sensitive information in Terraform outputs and why it is important.
Think about what happens if secret data is shown openly.
You got /4 concepts.