Yeah - the great thing about having real code is that you can use whatever templating and file system libraries you want on the language you are using. So you can open a file and use mustache templates if you want, or any other form of templating.
The only Pulumi specific thing to keep in mind is that you’ll want to instantiate and return the template from inside an
apply
(where you can get ahold of the output values).