This message was deleted.
# general
s
This message was deleted.
s
Hey there! I think you’re going to need to use multiple stacks here. Generally, to have multiple deployments of the same Pulumi program you need a separate stack for each deployment. You’ll probably need to modify your use of the Automation API to use separate stacks for each deployment.
b
Thanks for the reply, @salmon-account-74572. Apologies if I wasn't clear there. So the idea is that I am creating a new stack dynamically per request. They will all have a different StackName and ProjectName, but they hold the same infra components (a queue, a lambda, some roles and a mapping). That part seems to work well enough if I deploy them sequentially, but not if 2 or more requests hit my API at the same time. Currently, the way I'm doing it is by creating an
InlineProgramArgs
object based on information received from an HTTP POST, and then feeding that object into a
LocalWorkspace.createStack(args)
call. My expectation is that every time this is called, a new Stack instance is created for me. Am I offbase with this assumption?
e
The nodejs automation api can not run inline programs in parallel (we are looking into fixing this soon). Either lock around the call to createStack such that only one runs at a time, or use non-inline programs.
b
Thanks for the context, @echoing-dinner-19531. While this is unfortunate news, knowing the root cause was enough for me. Spinning it up using node's
fork
method seems to work fine enough. Less elegant, but working!
e
We do have an engineer looking into fixing this at the moment, working on the fix for python right now, but they'll look into nodejs after 🙂