Hey everyone, First of all, thank you for taking ...
# general
Hey everyone, First of all, thank you for taking the time to read this. We are currently using the
package in one of our projects (using node.js). I run the following only once, when starting the server:
Copy code
const stack: Stack = await LocalWorkspace.selectStack(
  stackName: `sample-stack`,
  workDir: 'sample'
  envVars: {
   AWS_ACCESS_KEY_ID: process.env.AWS_ACCESS_KEY_ID ?? '',
After this, I use the selected stack in my services and call
await stack.setConfig
to set some configuration values. This all works and the configuration is showing up perfectly fine in the pulumi ui for my specific stack. Also
pulumi up
runs without issues and uses the configuration as intended. However, when I redeploy my server from scratch and select the exact same stack with the code snippet above and then log
await stack.getAllConfig()
the configuration returns an empty object. I would expect the configuration that is visible in the pulumi ui, to be retrievable through this
await stack.getAllConfig()
even after redeploying from scratch. It does work when I do not redeploy or restart though, but this won’t last forever 😉 Am I missing something or doing something wrong here? Or is it not a feature of this package? Looking forward to your answers! 🙂
just to confirm, you’re running
after you’ve run a destroy?
will only return a value after a successgul
Thanks for your reply @billowy-army-68599 I take the following steps: 1. Start server and run the stack init/select, call some endpoints which sets configuration. Then I run a pulumi up which sets configurations and deploys resources. 2. Destroy server 3. Start server again from scratch and run a stack init/select. Then, without doing anything or running a pulumi up, I run
which returns an empty object. If I would run a pulumi up in step 3, after running the stack selection but before anything else, it cleans configurations and deletes all resources
stack init on its own won’t set any config.
you need to run
after you run
so selecting the existing stack wont give the possibility to get the already existing config from Pulumi (state)? Instead we need to store this configuration yaml somewhere and get it from this location to recover the previous configuration?
sorry, when you say “Destroy server” do you mean run a
pulumi destroy
or destroy the server you’re running automation API on?
yes destroy the server I am running the automation api on
ohhh, in that case, your local copy of the config hasn’t been retrieved, run a
first after you select the stack
ahh great, that worked. Tried a refresh before but must have made a mistake when using the
(since that one also cleaned my configuration) instead of the
😄 Thanks a lot 🙂