TERRAFORM-ASSOCIATE-004 · Question #2
Which of the following is not a valid Terraform variable type?
The correct answer is B. array. Terraform does not have a variable type called 'array.' The valid primitive types in Terraform are string, number, and bool; the valid complex/collection types are list, set, map, object, and tuple. Developers familiar with other languages often assume 'array' is valid, but Terra
Question
Options
- Alist
- Barray
- Cnap
- Dstring
How the community answered
(29 responses)- A3% (1)
- B86% (25)
- C7% (2)
- D3% (1)
Explanation
Terraform does not have a variable type called 'array.' The valid primitive types in Terraform are string, number, and bool; the valid complex/collection types are list, set, map, object, and tuple. Developers familiar with other languages often assume 'array' is valid, but Terraform uses 'list' for ordered sequences of values instead. 'string' (option D) is a valid primitive type, and 'list' (option A) is a valid collection type. 'nap' (option C) is also not a valid type, but 'array' is the answer that targets a common real-world misconception about Terraform's type system.
Topics
Community Discussion
No community discussion yet for this question.