https://pulumi.com logo
#general
Title
# general
c

calm-greece-42329

04/01/2020, 11:16 PM
is there something like pulumi.interpolate for dealing with files, or should i load into a string and do something else? ive got a configuration file that i want to add some Output’s to
b

breezy-cricket-40277

04/01/2020, 11:56 PM
I’m also looking forward to know the options that people are using. I’ve seen this exact scenario happening (load into a string) https://www.pulumi.com/blog/architecture-as-code-intro/#virtual-machines
There’s also a newer article dealing with this problem with Dynamic Providers, maybe one of this options could be used for your specific use-case: https://www.pulumi.com/blog/architecture-as-code-vm/
w

white-balloon-205

04/02/2020, 2:01 AM
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).
b

breezy-cricket-40277

04/02/2020, 8:31 AM
Indeed @white-balloon-205. Just in case someone needs a pointer, Here’s how I did it for a Linux VM creation in Typescript: Look at the
customData
.
2 Views