A locals block is the Terraform mechanism for naming a value once and reusing it everywhere, which keeps a configuration DRY and easy to read. The Terraform Locals Generator builds that block from a small form, so you can produce correctly quoted HCL without hand-writing attribute lines or worrying about string versus expression quoting. It is the quickest path from a list of values in your head to a paste-ready locals { } block.
Each local can be a string, number, bool or a raw HCL expression such as a resource reference. The generator validates the block as a whole: empty keys and duplicate keys are both reported, because a single locals block cannot contain two locals with the same name. Everything is assembled in your browser, so nothing is uploaded and no provider or cloud account is contacted. Use it to scaffold the locals for a new module, to normalise values copied from several sources, or to demonstrate the locals pattern in a workshop.
Because the output is ordinary HCL, it validates with terraform validate and slots into any module. The live local count and duplicate checks make it a gentle teaching tool: newcomers see immediately why a name must be unique and why an empty key is rejected, which prevents the most common locals mistakes before they reach a plan.
The generator also pairs naturally with code review: a reviewer can regenerate the locals from the form to confirm the intended types, which catches a string that should have been a number or a raw reference that was mistakenly quoted. Small type mistakes like those are easy to miss by eye but obvious once the block is rendered in canonical form.