From 08fd0a7e33b431fe31e901660b017494a247d5ee Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Mon, 22 Feb 2021 02:33:20 -0800 Subject: [PATCH] add a brief explanation of the difference between vars and locals in the docs for vars and locals (#10664) --- website/content/docs/templates/hcl_templates/locals.mdx | 9 +++++++++ .../content/docs/templates/hcl_templates/variables.mdx | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/website/content/docs/templates/hcl_templates/locals.mdx b/website/content/docs/templates/hcl_templates/locals.mdx index 5766ae37c..4e59ec863 100644 --- a/website/content/docs/templates/hcl_templates/locals.mdx +++ b/website/content/docs/templates/hcl_templates/locals.mdx @@ -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. diff --git a/website/content/docs/templates/hcl_templates/variables.mdx b/website/content/docs/templates/hcl_templates/variables.mdx index dd1107b95..3d303128a 100644 --- a/website/content/docs/templates/hcl_templates/variables.mdx +++ b/website/content/docs/templates/hcl_templates/variables.mdx @@ -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.