i'm writing it in Go so wondering if I can just im...
# general
b
i'm writing it in Go so wondering if I can just import pulumi internals directly
b
Unfortunately not. There’s an experimental branch out there that does this, but not currently. You need the CLI
b
is there something that makes this impossible? i can't import stuff from the
pkg
directory?
b
It’s definitely not impossible. Basically, for each language we’d need to start the grpc server. The best intermediate way to support that in each language was to use the CLI. I’ll try fish out the experimental branch later today
l
Linking the pulumi engine directly is possible, we have at least one user who does it. But it is not officially supported and documented. We have prototypes offering a version of automation API that works exactly as you describe https://github.com/pulumi/pulumi/issues/7219
b
gotcha thank you! will try it out
b
Also if you end up wanting to do this in Nodejs, we can probably make that dependency a lot less in your face … more like node-gyp. We link with another binary but it’s really an implementation detail of the AutomationAPI. In Go, of course, we can actually link directly with the engine itself.
b
ah cool that makes sense - playing with everything now so i understand how this works. If we write it in go is there still a way to execute nodejs programs? I couldn't tell if there was a single engine in go being coordinated through each language or if each language is a self contained thing
l
Yes. You can write pulumi programs in any language, and then write an automation API program that runs in another language. However, in this mode your pulumi programs are not "inline programs" but just standard pulumi programs either in a git repo or on disk somewhere: https://github.com/pulumi/automation-api-examples/tree/main/nodejs/crossLanguage-tsnode