nerdexam
HashiCorp

TA-002-P · Question #17

If a module uses a local variable, you can expose that value with a terraform output.

The correct answer is A. True. True. A module can define an output block that references a local value (locals block), effectively exposing that computed or assigned value to the parent module or to the terraform output command. Local variables are scoped to the module they are declared in, but output blocks…

Interact with Terraform modules

Question

If a module uses a local variable, you can expose that value with a terraform output.

Options

  • ATrue
  • BFalse

How the community answered

(22 responses)
  • A
    95% (21)
  • B
    5% (1)

Explanation

True. A module can define an output block that references a local value (locals block), effectively exposing that computed or assigned value to the parent module or to the terraform output command. Local variables are scoped to the module they are declared in, but output blocks serve as the explicit interface for passing values outward, regardless of whether those values originate from resources, data sources, or locals.

Topics

#Terraform locals#Terraform outputs#Terraform modules#Module data exposure

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice