nerdexam
HashiCorp

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

Submitted by naveen.iyer· Apr 18, 2026Work with Terraform Configurations

Question

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

Options

  • Alist
  • Barray
  • Cnap
  • Dstring

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    86% (25)
  • C
    7% (2)
  • D
    3% (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

#Terraform variables#Data types#Type constraints#Input variables

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice