You can list a directory, read all the json that dir (in a single list/map comprehension/building expression) and use that to feed your modules that manage the actual terraform resources.
When you realize that terraform modules are functions, terraform become a usable functional language.
Why would I want to generate some terraform when I can simply use it to generate the desired state using my higher level data ?
> terraform modules are functions
You seem to have found this feature useful. Doesn't that answer your question about why you would want a configuration language to have functions?
... all requiring potentially complex generation of configuration.
I am just skeptical that past some level of complexity, terraform requires a generator.In that sentence, I believe their meaning is that Terraform's language is already capable of generating configuration, and in fact this is a feature which is quite essential to Terraform's use. They acknowledge that all these projects (Nix, Terraform, Bazel, etc) already utilize relatively sophisticated programming languages for configuration. Nickel merely aims to be a better designed language for the purpose.