terraform/lang/funcs
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
..
testdata lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00
cidr.go lang/funcs: cidrsubnets function 2019-09-20 15:58:01 -07:00
cidr_test.go lang/funcs: cidrsubnets function 2019-09-20 15:58:01 -07:00
collection.go make the merge function more precise 2020-02-05 13:46:08 -05:00
collection_test.go update merge docs to match behavior 2020-02-05 15:47:36 -05:00
conversion.go lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
conversion_test.go lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
crypto.go remove satori/go.uuid in favor of google/uuid 2019-08-09 15:09:41 -04:00
crypto_test.go lang/funcs: New "uuidv5" function 2019-06-07 14:38:22 -07:00
datetime.go cleanup comments for nicer godocs 2018-10-16 18:49:20 -07:00
datetime_test.go cleanup comments for nicer godocs 2018-10-16 18:49:20 -07:00
encoding.go base64decode: check that the decoded (not encoded) string is valid UTF-8 2018-10-16 18:49:20 -07:00
encoding_test.go base64decodeFunc now checks for valid UTF-8 2018-10-16 18:49:20 -07:00
filesystem.go lang/funcs: templatefile requires valid variable names 2020-02-25 10:19:46 -05:00
filesystem_test.go lang/funcs: templatefile requires valid variable names 2020-02-25 10:19:46 -05:00
number.go lang/funcs: parseint function 2019-09-17 15:33:22 -07:00
number_test.go lang/funcs: parseint function 2019-09-17 15:33:22 -07:00
string.go lang/funcs: Add more `trim*` functions (#23016) 2019-11-18 08:31:44 -05:00
string_test.go lang/funcs: Add more `trim*` functions (#23016) 2019-11-18 08:31:44 -05:00