Hey! I'm playing around with the Automation API, a...
# automation-api
c
Hey! I'm playing around with the Automation API, and from my understanding you require a local file system to create the LocalWorkspace, and set the
workDir
? I get that you probably need a local file system to install the plugins etc into, but shouldn't we be able to store the stack configurations elsewhere, e.g. together with the state in a state backend?
m
My understanding is when you use the Automation API, it’s still something like the Pulumi CLI under the hood, so it still expects the same ecosystem around it. Pulumi.yaml and a working dir and such.
If the question question is "Couldn't it not work that way?" ... yes, perhaps if there are no theoretical limits, 🀷 , but it doesn't πŸ™‚
c
It would be wonderful if there were no theoretical limits! 😌 πŸ˜‚
🀣 1
I was mostly wondering if I was missing something, or if there was a way to somehow get the stack configurations created elsewhere
My idea stems from thinking about have a centralized location for several instances of the same application, and the idea then was to use the Postgresql-state backend, mostly as a fun project
It isn't really a real use-case, a theoretical one more like it
I was so busy wonder if I could, that I didn't stop to think if I should πŸ˜‰
m
πŸ™‚
I don't think you are missing anything. It would probably be easiest to wrap some kind of temp dir around things to make it work as is, but taht would still need a writable file system.
Someone in here might know more than me though.
m
I was mostly wondering if I was missing something, or if there was a way to somehow get the stack configurations created elsewhere
You can use
pulumi stack select $MY_STACK && pulumi config refresh
to get the latest deployed configuration for your stack. This functionality is also wrapped/exposed by the Automation API: https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/automation/localWorkspace.ts#L792 If you want to share configurations without deploying them, as far as I'm aware you'll need to use a separate system (Git or some data store, I've used the AWS SSM Parameter Store or secret managers for this purpose, but anywhere you can store YAML- or JSON-like objects will do).
c
Hmm, interesting so it seems plausible to kind of just ignore the local stack-files, and always fetch what is deployed. πŸ€”
πŸ‘ 1