![]() It's a common source of errors to try to produce JSON or YAML syntax using string concatenation via our template language but to miss some details like correct string escaping, quoting, required commas, etc. The jsonencode and yamlencode functions are a better way to generate JSON and YAML, but it's not immediately obvious that both of these functions are available for use in external templates (via templatefile) too. Given that questions related to this come up a lot in our community forum and elsewhere, it seems worth having a documentation section to show the pattern of having a template that consists only of a single function call. |
||
---|---|---|
.. | ||
backends | ||
commands | ||
configuration | ||
configuration-0-11 | ||
import | ||
internals | ||
modules | ||
plugins | ||
providers | ||
provisioners | ||
registry | ||
state | ||
cli-index.html.md |