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

brash-finland-19802

09/30/2023, 9:25 PM
i'm writing it in Go so wondering if I can just import pulumi internals directly
b

billowy-army-68599

10/01/2023, 2:21 AM
Unfortunately not. There’s an experimental branch out there that does this, but not currently. You need the CLI
b

brash-finland-19802

10/01/2023, 6:14 AM
is there something that makes this impossible? i can't import stuff from the
pkg
directory?
b

billowy-army-68599

10/01/2023, 2:55 PM
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

lemon-agent-27707

10/01/2023, 5:05 PM
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

brash-finland-19802

10/01/2023, 10:24 PM
gotcha thank you! will try it out
b

big-piano-35669

10/02/2023, 2:03 AM
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

brash-finland-19802

10/02/2023, 2:29 PM
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

lemon-agent-27707

10/02/2023, 4:17 PM
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