Recall & Review
beginner
What is a module output in Terraform?
A module output is a way to expose values from a Terraform module so that they can be used by the root module or other modules. It acts like a window to see important information from inside the module.
Click to reveal answer
beginner
How do you define an output in a Terraform module?
You define an output using the
output block with a name and a value. For example:<br>output "instance_ip" {<br> value = aws_instance.example.public_ip<br>}Click to reveal answer
beginner
Why should you use outputs in Terraform modules?
Outputs help share important information like IP addresses, IDs, or URLs from a module to other parts of your configuration or to users. This makes your infrastructure easier to connect and manage.
Click to reveal answer
beginner
How do you access a module output in the root module?
You access it using the syntax
module.<module_name>.<output_name>. For example, if your module is called webserver and output is instance_ip, you use module.webserver.instance_ip.Click to reveal answer
intermediate
Can module outputs be sensitive? How do you mark them?
Yes, outputs can be marked as sensitive by adding
sensitive = true inside the output block. This hides the value from Terraform's normal output to protect secrets.Click to reveal answer
What is the purpose of an output block in a Terraform module?
✗ Incorrect
Outputs expose values from a module so other parts of the configuration can use them.
How do you reference an output named 'db_password' from a module called 'database'?
✗ Incorrect
Module outputs are accessed with module.. syntax.
Which keyword marks an output as sensitive in Terraform?
✗ Incorrect
The 'sensitive = true' flag hides output values from normal display.
What happens if you do not define outputs in a module?
✗ Incorrect
Without outputs, values inside a module are not accessible outside it.
Which of the following is a valid output block in Terraform?
✗ Incorrect
The correct syntax uses output "name" { value = ... } with quotes and braces.
Explain how Terraform module outputs help in connecting different parts of infrastructure.
Think about how you share important info from one part to another.
You got /4 concepts.
Describe how to define and use a sensitive output in a Terraform module.
Consider how to hide passwords or keys in outputs.
You got /4 concepts.