nerdexam
HashiCorp

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.

Read, generate, and modify configuration

Question

Which of the following arguments are required when declaring a Terraform output?

Options

  • Asensitive
  • Bdescription
  • Cdefault
  • Dvalue

How the community answered

(24 responses)
  • A
    4% (1)
  • B
    8% (2)
  • D
    88% (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.

Asensitive

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.

Bdescription

The `description` argument is optional and provides a human-readable explanation of the output's purpose, but it is not required.

Cdefault

The `default` argument is not a valid argument for an `output` block; it is used specifically with `variable` blocks to provide a fallback value.

DvalueCorrect

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

#Terraform outputs#HCL syntax#Required arguments#Configuration language

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice