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

worried-city-86458

05/17/2021, 5:37 AM
What should be the order of calls for the automation api equivalent of repairing stack state? I think that config should still be set before doing the export / import, or does it not matter? (I did a repair at one point before doing this and config was wiped from the ui) So looks like the following makes sense and is consistent with the above: • var stack = LocalWorkspace.CreateOrSelectStackAsync • stack.Workspace.InstallPluginAsync • stack.SetAllConfigAsync • stack.ExportStackAsync • // repair stack • stack.ImportStackAsync
l

lemon-agent-27707

05/17/2021, 2:48 PM
It should not matter. But remember that config is only persisted in backends on update, not on each intermediate
config set
command. I would expect you to need to do something along the following: 1. export 2. // fix 3. import 4. (setup commands, install plugins, config, etc) 5. refresh/update
w

worried-city-86458

05/17/2021, 9:59 PM
@lemon-agent-27707 Follow up question... if I import the stack unchanged, i.e. not edited so still with pending resources, should they be preserved or would you expect pending resources to be stripped by the import?
l

lemon-agent-27707

05/17/2021, 10:00 PM
running an export/import does indeed strip pending deletes
w

worried-city-86458

05/17/2021, 10:01 PM
Pending deletes or pending resources in general?
I ask because I think my eks cluster state was deleted while I was playing around with this stuff
(My stack failed for an unrelated reason before eks cluster finished in aws - takes 10-15m) So I was mucking about with stack repair in the meantime and at some point the state got deleted
I just want to make sure I fully understand how an interactive repair might work ... e.g. if I don't make any changes then I should not call import afterwards, otherwise pending resources will be stripped.
And if that's the case it kinda feels like it would be safer to not strip pending resources by default
l

lemon-agent-27707

05/17/2021, 10:16 PM
👍 1