67d95b97ce
Previously the templatefile function would permit any arbitrary string as a variable name, but due to the HCL template syntax it would be impossible to refer to one that isn't a valid HCL identifier without causing an HCL syntax error. The HCL syntax errors are correct, but don't really point to the root cause of the problem. Instead, we'll pre-verify that the variable names are valid before we even try to render the template, and given a specialized error message that refers to the vars argument expression as the problematic part, which will hopefully make the resolution path clearer for a user encountering this situation. The syntax error still remains for situations where all of the variable names are correct but e.g. the user made a typo referring to one, which makes sense because in that case the problem _is_ inside the template. |
||
---|---|---|
.. | ||
functions | ||
attr-as-blocks.html.md | ||
data-sources.html.md | ||
expressions.html.md | ||
functions.html.md | ||
index.html.md | ||
locals.html.md | ||
modules.html.md | ||
outputs.html.md | ||
override.html.md | ||
providers.html.md | ||
resources.html.md | ||
style.html.md | ||
syntax-json.html.md | ||
syntax.html.md | ||
terraform-enterprise.html.md | ||
terraform.html.md | ||
types.html.md | ||
variables.html.md |