nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #84

Which Terraform collection type should you use to store key/value pairs?

The correct answer is B. Map. The Terraform collection type that should be used to store key/value pairs is map. A map is a collection of values that are accessed by arbitrary labels, called keys. The keys and values can be of any type, but the keys must be unique within a map. For example, var = { key1 =…

Submitted by haruto_sh· Apr 18, 2026Understand Terraform Basics

Question

Which Terraform collection type should you use to store key/value pairs?

Options

  • ASet
  • BMap
  • CTuple
  • Dlist

How the community answered

(50 responses)
  • A
    4% (2)
  • B
    94% (47)
  • D
    2% (1)

Explanation

The Terraform collection type that should be used to store key/value pairs is map. A map is a collection of values that are accessed by arbitrary labels, called keys. The keys and values can be of any type, but the keys must be unique within a map. For example, var = { key1 = "value1", key2 = "value2" } is a map with two key/value pairs. Maps are useful for grouping related values together, such as configuration options or metadata.

Topics

#Terraform data types#collection types#maps#key-value pairs

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice