terraform-associate question 328 discussion

View all HashiCorp Certified: Terraform Associate Exam here
back to hashicorp forum

Question 328

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

  • A. type
  • B. default
  • C. description
  • D. None of the above
Answer:

A


User Votes:
A 1 votes
50%
B
50%
C
50%
D 5 votes
50%
Discussions
0 / 1000
nassimaelferkhsi
8 months, 3 weeks ago

In Terraform, when declaring a variable, none of the arguments are strictly required.

sunil123
3 months ago

Answer is D.

misosan1
1 month, 3 weeks ago

All arguments are optional:
Arguments
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.
ephemeral - This variable is available during runtime, but not written to state or plan files.
sensitive - Limits Terraform UI output when the variable is used in configuration.
nullable - Specify if the variable can be null within the module.