:wave: Is there any equivalent of <https://develop...
# general
g
g
Interpolate requires string literals, I have a file because I am going to rewrite Terraform code into pulumi
d
I don't think there's anything built in, you'd need to run a templating library within an
.apply()
call
g
I'd run it prior to apply but that does not matter. Any useful templating library would do. Though I do not have experience with any in TS/JS
d
I only know of Mustache and Handlebars, not too familiar with the ecosystem
f
TS has "template strings" built in, they look like:
Copy code
const greeting = `Hello, ${name}!`;
The contents of the
${}
can be any JS expression, including function calls / ternary expressions / whatever you need.
The default way that these are resolved just pulls in variables via `.toString()`; but they can also be "tagged" with a custom function to resolve them - this lets us do crazy stuff like
Copy code
const section = html`<section>${renderSectionContents()}</section>`;
And/or register click handlers and the like. Pulumi's
interpolate
tag works the same way