nerdexam
HashiCorp

TA-002-P · Question #328

Which argument(s) are required when declaring a Terraform variable?

The correct answer is E. None of the above. Terraform CLI defines the following OPTIONAL arguments for variable declarations: default - A default value which then makes the variable optional. type - This argument specifies what value types are accepted for the variable. description - This specifies the input variable's…

Read, generate, and modify configuration

Question

Which argument(s) are required when declaring a Terraform variable?

Options

  • Atype
  • Bdefault
  • Cdescription
  • DAll of the above
  • ENone of the above

How the community answered

(51 responses)
  • A
    2% (1)
  • C
    6% (3)
  • D
    2% (1)
  • E
    90% (46)

Explanation

Terraform CLI defines the following OPTIONAL arguments for variable declarations: default - A default value which then makes the variable optional. type - This argument specifies what value types are accepted for the variable. description - This specifies the input variable's documentation. validation - A block to define validation rules, usually in addition to type constraints. sensitive - Limits Terraform UI output when the variable is used in configuration. nullable - Specify if the variable can be null within the module.

Topics

#Terraform variables#HCL syntax#Required arguments

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice