What is the difference between locals and variables?
BeginnerConceptVariables, Locals, Outputs and Types
Answer
Variables are inputs set by the caller. Locals are named expressions internal to the module, computed from variables, resources and other locals. Use locals to avoid repeating an expression or to give a derived value a name, like local.name_prefix = "${var.app}-${var.env}"; do not use them as disguised inputs.
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 are the primitive types in Terraform?BeginnerHow do list, set and map differ?IntermediateWhat are `object` and `tuple` types?Intermediate