Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 133

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

    Correct Answer: C

    In Terraform, the collection type used to store key/value pairs is called a 'map'. A map is an unordered collection where each element is identified by a unique key. This key is associated with a value, effectively making it a key/value pair. Maps are particularly useful for storing configuration parameters or metadata where the order of elements is not important. Other collection types like tuples, sets, and lists, have different characteristics and use cases, but they do not efficiently support key/value pair representation like maps do.

Discussion
Uma10

The answer is correct. Maps/objects are represented by a pair of curly braces containing a series of <KEY> = <VALUE> pairs Source: https://www.terraform.io/language/expressions/types

campsOption: C

C. map is the Terraform collection type that should be used to store key/value pairs. A map is an unordered collection of key/value pairs, where each key is unique. It can be used to store related data that doesn't have a specific order, and it's useful for storing configuration parameters or metadata associated with infrastructure resources. A tuple is an ordered collection of elements, a set is an unordered collection of unique elements, and a list is an ordered collection of elements that can include duplicates. While each of these collection types has its own uses, a map is the most appropriate type for storing key/value pairs.

debabrata6983Option: C

map collection

Pinky0289Option: C

Elements stored in key=value pairs within curly braces is a map. So, the right option is C.

depal_dhirOption: C

C - Map is the correct answer https://www.terraform.io/language/expressions/types

keiffo2

map variable is key-value

keiffo2

so C is the right anwer