Which Terraform collection type should you use to store key/value pairs?
Which Terraform collection type should you use to store key/value pairs?
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.
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
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.
map collection
Elements stored in key=value pairs within curly braces is a map. So, the right option is C.
C - Map is the correct answer https://www.terraform.io/language/expressions/types
map variable is key-value
so C is the right anwer