https://pulumi.com logo
Title
r

rich-dress-42878

10/08/2022, 6:07 AM
Soft question: do you guys prefer using inline or local program execution (or both, of course!) when working with the automation API? I am driving some projects with the automation API and going back and forth on how to structure them, and am trying to stay consistent. Currently each of my subprojects is a local Pulumi program, omitting inline execution entirely. Kind of trivial but would love to hear any thoughts on this (appreciate Pulumi's flexibility in that regard in the first place honestly)
b

billowy-army-68599

10/08/2022, 3:50 PM
I use inline programs in Go mainly because of the ability to bundle everything as a binary (example: https://github.com/jaxxstorm/connectme) For anything that doesn’t need a bundled binary I use local programs
r

rich-dress-42878

10/08/2022, 8:28 PM
That's a great point!! Thanks for your response 👍
Is there a specific reason you don't use inline programs for non-binary bundle use cases? Prefer the isomorphic approach/portability of the projects, like the Pulumi manifest config control, etc.
r

red-match-15116

10/09/2022, 11:10 PM
I guess 1 benefit of not using inline programs is that you can drive that program using either automation API or the CLI - whereas with inline programs you can only use automation API to execute them
That being said, when I've used automation API for projects I've almost exclusively used inline programs just for simplicity and ease.
r

rich-dress-42878

10/10/2022, 12:29 AM
Awesome @red-match-15116, thanks for your input. That's what I was thinking too. No joke, almost DM'd you with your deep experience of the automation API haha. Thanks for all the work you put into it/the automation examples/etc.!
r

red-match-15116

10/10/2022, 12:45 AM
Thanks for the kind words @rich-dress-42878!
l

lemon-agent-27707

10/10/2022, 3:57 PM
It is possible to have the best of both worlds with a little bit of refactoring. We don't have an example of this for nodejs, but here is a program in go that can be run both via the CLI and via inline program: https://github.com/pulumi/automation-api-examples/tree/main/go/inline_local_hybrid
r

rich-dress-42878

10/10/2022, 7:02 PM
Thanks @lemon-agent-27707! I was originally doing that with my current project since I couldn't decide between the two, now switched to pure inline programs. The Go examples have been very helpful and I love how flexible the automation API is/how many ways you can go about it