terraform/lang
Martin Atkins 67d95b97ce lang/funcs: templatefile requires valid variable names
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.
2020-02-25 10:19:46 -05:00
..
blocktoattr vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
funcs lang/funcs: templatefile requires valid variable names 2020-02-25 10:19:46 -05:00
testdata/functions-test lang/funcs: Update fileset() function to include path as separate first argument, automatically trim the path argument from results, and ensure results are always canonical with forward slash path separators 2019-08-30 20:19:44 -04:00
data.go change GetResourceInstance to GetResource 2019-09-19 09:19:14 -04:00
data_test.go change lang eval to also only lookup resources 2019-09-19 11:46:09 -04:00
doc.go lang: new package for the runtime parts of the config language 2018-10-16 18:44:26 -07:00
eval.go correctly evaluate self in for_each resources 2019-10-29 12:44:42 -04:00
eval_test.go Merge pull request #22846 from hashicorp/jbardin/evaluate-resource 2019-10-08 07:57:15 -04:00
functions.go lang: add setsubtract function (#23424) 2020-02-06 12:49:11 -05:00
functions_test.go lang: add setsubtract function (#23424) 2020-02-06 12:49:11 -05:00
references.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
scope.go terraform: ugly huge change to weave in new HCL2-oriented types 2018-10-16 18:46:46 -07:00