website/content/docs/templates/hcl_templates/blocks/variable.mdx
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
[!IMPORTANT]
Documentation Update: Product documentation previously located in/websitehas moved to thehashicorp/web-unified-docsrepository, where all product documentation is now centralized. Please make contributions directly toweb-unified-docs, since changes to/websitein this repository will not appear on developer.hashicorp.com. ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
variable blockThis topic provides reference information about the variable block.
The variable and input-variable blocks define variables
within your Packer configuration. You cannot use the input-variable block in another input-variable block. We recommend using the locals to nest variables instead.
@include 'from-1.5/variables/foo-block.mdx'
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'