TA-002-P · Question #64
Which of the following is not a valid Terraform collection type?
The correct answer is C. tree. Among the choices, 'tree' is not a recognized native collection type in Terraform; valid collection types include lists, maps, and sets.
Question
Which of the following is not a valid Terraform collection type?
Options
- Alist
- Bmap
- Ctree
- Dset
How the community answered
(62 responses)- A2% (1)
- B8% (5)
- C87% (54)
- D3% (2)
Why each option
Among the choices, 'tree' is not a recognized native collection type in Terraform; valid collection types include lists, maps, and sets.
'list' is a valid Terraform collection type, representing an ordered sequence of values.
'map' is a valid Terraform collection type, representing a collection of key-value pairs.
Terraform explicitly supports 'list' (ordered collection of values), 'map' (collection of key-value pairs), and 'set' (unordered collection of unique values) as its primary collection types. There is no native or standard collection type called "tree" in Terraform's type system.
'set' is a valid Terraform collection type, representing an unordered collection of unique values.
Concept tested: Terraform collection data types
Source: https://developer.hashicorp.com/terraform/language/expressions/types
Topics
Community Discussion
No community discussion yet for this question.