07/05/2021, 2:48 PM
When using the automation API I sometimes wish to schedule a workspace.Refresh() followed by an workspace.Up(). Should the workspace be recreated between these calls or is it safe to call Refresh then Up consecutively using the same workspace instance? My motivation here is to speed up deployments because in the case of a small component stack I find the workspace initialization is about 30% of the overall deployment time. I am using the C# Pulumi sdk.


07/05/2021, 8:03 PM
If you are allowing the workspace to create its own working directory than it will be making it in your machines temp directory so you might want to verify that that is still around before doing additional work with the same workspace instance. But if from the beginning you specify a working directory that you control outside of your machines temp directory than whether or not that is still around would be entirely up to you.