nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #245

If a module declares a variable without a default value, you must pass the value of the variable within the module block when you call the module in your configuration.

The correct answer is A. True. True. A module variable declared without a default value is required - it has no fallback. Any root or parent module that calls it must explicitly supply a value for that variable in the module block. If the value is omitted, Terraform will raise an error during the plan phase…

Submitted by miguelv· Apr 18, 2026Work with Terraform Modules

Question

If a module declares a variable without a default value, you must pass the value of the variable within the module block when you call the module in your configuration.

Options

  • ATrue
  • BFalse

How the community answered

(20 responses)
  • A
    95% (19)
  • B
    5% (1)

Explanation

True. A module variable declared without a default value is required - it has no fallback. Any root or parent module that calls it must explicitly supply a value for that variable in the module block. If the value is omitted, Terraform will raise an error during the plan phase. Only variables declared with a default value are optional in the calling module block; the default is used automatically when no value is provided.

Topics

#Terraform modules#Module variables#Required variables#Module inputs

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice