Skill 4.3.4
Local values
Key Concepts
A locals block defines one or more named values, such as name_prefix = "${var.project}-${var.environment}" or a merged map of common tags, and expressions refer to them as local.NAME (singular). Locals can reference variables, resources, data sources and other locals.
Unlike variables, locals cannot be set from outside the module, so they suit derived values and constants. Use them to avoid repeating an expression, but not so heavily that readers must chase every value through several definitions.