Zachary Shilton 830140157d
website: remove obselete nav data (#10811)
* website: remove obselete sidebar_title frontmatter from docs

* website: bump to latest docs-page

* website: update plugin creation and registration docs

* website: fix broken links
2021-03-31 15:07:00 -04:00

40 lines
1.1 KiB
Plaintext

---
description: >
The variable block, also called the input-variable block, defines variables
within your Packer configuration.
page_title: variable - Blocks
---
# The `variable` block
`@include 'from-1.5/beta-hcl2-note.mdx'`
The `variable` block, also called the `input-variable` block, defines variables
within your Packer configuration. An input-variable cannot be used in another
input variable: we recommend using [locals](/docs/templates/hcl_templates/blocks/locals) for that instead.
`@include 'from-1.5/variables/foo-block.mdx'`
## Default value
If a default value is set, the variable is optional. Otherwise, the variable
**must** be set.
`@include 'from-1.5/variables/assignment.mdx'`
`@include 'from-1.5/variables/custom-validation.mdx'`
Example of a variable assignment from a file:
`@include 'from-1.5/variables/foo-pkrvar.mdx'`
`@include 'from-1.5/variables/must-be-set.mdx'`
`@include 'from-1.5/variables/sensitive.mdx'`
# More on variables
- Read the [full variables](/docs/templates/hcl_templates/variables) description for a more
thorough read.
- Read the [variables guide](/guides/hcl/variables) for more examples.