terraform/lang
Martin Atkins 02576988c1 lang: "try" and "can" functions
These are intended to make it easier to work with arbitrary data
structures whose shape might not be known statically, such as the result
of jsondecode(...) or yamldecode(...) of data from a separate system.

For example, in an object value which has attributes that may or may not
be set we can concisely provide a fallback value to use when the attribute
isn't set:

    try(local.example.foo, "fallback-foo")

Using a "try to evaluate" model rather than explicit testing fits better
with the usual programming model of the Terraform language where values
are normally automatically converted to the necessary type where possible:
the given expression is subject to all of the same normal type conversions,
which avoids inadvertently creating a more restrictive evaluation model
as might happen if this were handled using checks like a hypothetical
isobject(...) function, etc.
2020-01-10 15:23:25 -08:00
..
blocktoattr vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
funcs lang/funcs: Add more `trim*` functions (#23016) 2019-11-18 08:31:44 -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: "try" and "can" functions 2020-01-10 15:23:25 -08:00
functions_test.go lang: "try" and "can" functions 2020-01-10 15:23:25 -08: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