TA-002-P · Question #431
Which of the following arguments are required when declaring a Terraform output?
The correct answer is D. value. The value argument is the only required component when defining a Terraform output, as it specifies the actual data to be exposed.
Question
Which of the following arguments are required when declaring a Terraform output?
Options
- Asensitive
- Bdescription
- Cdefault
- Dvalue
How the community answered
(24 responses)- A4% (1)
- B8% (2)
- D88% (21)
Why each option
The `value` argument is the only required component when defining a Terraform output, as it specifies the actual data to be exposed.
The `sensitive` argument is optional and is used to mark an output's value as sensitive, preventing it from being displayed in plain text in the CLI.
The `description` argument is optional and provides a human-readable explanation of the output's purpose, but it is not required.
The `default` argument is not a valid argument for an `output` block; it is used specifically with `variable` blocks to provide a fallback value.
The `value` argument is mandatory for an output block because it defines the data or expression that the output will expose, making it the core component.
Concept tested: Terraform output block arguments
Source: https://developer.hashicorp.com/terraform/language/values/outputs
Topics
Community Discussion
No community discussion yet for this question.