What are good uses of locals, and what are the limits?
IntermediateConceptVariables, Locals, Outputs and Types
Answer
Naming derived values, merging tag maps, building maps for for_each and avoiding repeated expressions. Locals can reference other locals but not form cycles. Overusing locals for a hundred small things makes code harder to read than a plain literal; if a value is configurable by the caller, make it a variable instead.
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?BeginnerHow do list, set and map differ?Intermediate