https://pulumi.com logo
#automation-api
Title
# automation-api
b

brash-hairdresser-60389

10/26/2022, 3:53 PM
Hello everyone again; another question, unfortunately. Is there a way to configure the LocalWorkspace indicating where to save the pulumi state folder of automated stacks? Imagine the case I have the Automation API behind an HTTP server (like the example provided by Pulumi) running in Kubernetes, I don’t want the pulumi state folder to reside in the POD running the HTTP server (because it is stateless); I want to use an external folder where I can store and rework the stacks for subsequent actions.
b

bored-oyster-3147

10/26/2022, 5:10 PM
I would instead configure your automation API use to provide a directory to local workspace instead of allowing automation api to create one. If automation api creates the directory, than it will also try to clean it up after - which will defeat the purpose of controlling that location per your use case.
b

brash-hairdresser-60389

10/26/2022, 10:06 PM
Good point, thanks. The question is, what’s the setting to configure to make the LocalWorkspace work with such a folder?
b

bored-oyster-3147

10/26/2022, 10:16 PM
When you instantiate a local workspace it should take in some arguments, one of which is a working directory
b

brash-hairdresser-60389

10/26/2022, 11:09 PM
Ok.. so the working directory is the folder that will create the pulumi state folder? Am I assuming correctly? Thanks a lot
b

bored-oyster-3147

10/26/2022, 11:48 PM
Ohhhh no. The working directory is the folder where the project file and the stack settings files are. The directory where the state files are is called the “backend.” There is an environment variable you can set to control that, or it is a value in the project settings.
I’m sorry I missed where you said state in your original question.
b

brash-hairdresser-60389

10/27/2022, 12:12 AM
no worries, thanks anyway for your help
2 Views