opentofu/lang/funcs/testdata
Martin Atkins c753df6a93 lang/funcs: templatefile function
This function is similar to the template_file data source offered by the
template provider, but having it built in to the language makes it more
convenient to use, allowing templates to be rendered from files anywhere
an inline template would normally be allowed:

    user_data = templatefile("${path.module}/userdata.tmpl", {
      hostname = format("petserver%02d", count.index)
    })

Unlike the template_file data source, this function allows values of any
type in its variables map, passing them through verbatim to the template.
Its tighter integration with Terraform also allows it to return better
error messages with source location information from the template itself.

The template_file data source was originally created to work around the
fact that HIL didn't have any support for map values at the time, and
even once map support was added it wasn't very usable. With HCL2
expressions, there's little reason left to use a data source to render
a template; the only remaining reason left to use template_file is to
render a template that is constructed dynamically during the Terraform
run, which is a very rare need.
2018-12-21 08:06:14 -08:00
..
bare.tmpl lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00
func.tmpl lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00
hello.tmpl lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00
hello.txt lang/funcs: port some of Terraform's built-in functions 2018-10-16 18:48:28 -07:00
icon.png lang/funcs: port some of Terraform's built-in functions 2018-10-16 18:48:28 -07:00
list.tmpl lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00
recursive.tmpl lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00