nerdexam
HashiCorp

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.

Understand Terraform basics

Question

Which of the following is not a valid Terraform collection type?

Options

  • Alist
  • Bmap
  • Ctree
  • Dset

How the community answered

(62 responses)
  • A
    2% (1)
  • B
    8% (5)
  • C
    87% (54)
  • D
    3% (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.

Alist

'list' is a valid Terraform collection type, representing an ordered sequence of values.

Bmap

'map' is a valid Terraform collection type, representing a collection of key-value pairs.

CtreeCorrect

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.

Dset

'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

#Terraform data types#Collection types#Lists#Maps

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice