add a brief explanation of the difference between vars and locals in the docs for vars and locals (#10664)

This commit is contained in:
Megan Marsh 2021-02-22 02:33:20 -08:00 committed by GitHub
parent 079786f8d0
commit 08fd0a7e33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -10,6 +10,15 @@ description: >-
`@include 'from-1.5/beta-hcl2-note.mdx'`
There are two kinds of variables in HCL Packer templates: Input variables,
sometimes simply called "variables", and Local variables, also known as
"locals". Input variables may have defaults, but those defaults can
be overridden from the command line or special variable files. Local variables
can be thought of as constants, and are not able to be overridden at runtime.
This page is about local variables. To learn about input variables, see the
[input variables](/docs/templates/hcl_templates/variables) page.
Local values assign a name to an expression, that can then be used multiple
times within a folder.

View File

@ -10,6 +10,15 @@ description: |-
`@include 'from-1.5/beta-hcl2-note.mdx'`
There are two kinds of variables in HCL Packer templates: Input variables,
sometimes simply called "variables", and Local variables, also known as
"locals". Input variables may have defaults, but those defaults can
be overridden from the command line or special variable files. Local variables
can be thought of as constants, and are not able to be overridden at runtime.
This page is about input variables. To learn about local variables, see the
[locals](/docs/templates/hcl_templates/locals) page.
Input variables serve as parameters for a Packer build, allowing aspects of the
build to be customized without altering the build's own source code.