---
description: >
  The `locals` and `local-variable` blocks declare local variables in
  your Packer configuration. Learn how to use these blocks to declare local variables in your template.
page_title: locals block reference
---

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
> [!IMPORTANT]  
> **Documentation Update:** Product documentation previously located in `/website` has moved to the [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs) repository, where all product documentation is now centralized. Please make contributions directly to `web-unified-docs`, since changes to `/website` in this repository will not appear on developer.hashicorp.com.
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

# `locals` block

This topic provides reference information about the `locals` block.

## Description

The `locals` and `local-variable` blocks declare local variables in
your Packer configuration.

`@include 'from-1.5/locals/example-block.mdx'`

Refer to the following topics for additional information about using the `locals` and `local-variable` blocks:

- [Local Variables](/packer/docs/templates/hcl_templates/locals)
- [Input Variables and local variables](/packer/guides/hcl/variables)
