This message was deleted.
# general
s
This message was deleted.
b
just to confirm, you’re running
stack.getAllConfig()
after you’ve run a destroy?
stack.getAllConfig
will only return a value after a successgul
stack.up
operation
c
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
stack.getAllConfig()
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
b
stack init on its own won’t set any config.
you need to run
getAllConfig
after you run
setConfig
c
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?
b
sorry, when you say “Destroy server” do you mean run a
pulumi destroy
?
or destroy the server you’re running automation API on?
c
yes destroy the server I am running the automation api on
b
ohhh, in that case, your local copy of the config hasn’t been retrieved, run a
refresh
first after you select the stack
c
ahh great, that worked. Tried a refresh before but must have made a mistake when using the
pulumi.refresh()
(since that one also cleaned my configuration) instead of the
pulumi.refreshConfig()
😄 Thanks a lot 🙂
🎉 1