How do list, set and map differ?
IntermediateConceptVariables, Locals, Outputs and Types
Answer
A list(T) is ordered and allows duplicates and is indexed by position. A set(T) is unordered with unique values and has no index, so you cannot do set[0]. A map(T) has string keys with values of one type. for_each accepts a map or set of strings; convert lists with toset().
More on Variables, Locals, Outputs and Types
How do you declare an input variable?BeginnerIn what order does Terraform load variable values?BeginnerHow do you define an output and what is it for?BeginnerWhat is the difference between locals and variables?BeginnerWhat are the primitive types in Terraform?BeginnerWhat are `object` and `tuple` types?Intermediate