is it possible to ensure pulumi does not delete a ...
# general
d
is it possible to ensure pulumi does not delete a stack if there are other stacks depending on it? (I’ve searched in slack already for pulumi destroy in a couple of ways and nothing relevant turned up).
l
I don't think so. Stacks know which other stacks they depend on; they don't know which stack depend on them.
b
One option might be to use automation api.
d
I considered this - I know our guys have made the mistake of nuking a stack that was a dependancy…. not a pretty sight.
l
Sounds like your permissions are... too permissive 😉
Stack deletion should require more than a simple PR!
p
In this case it was someone deleting a portion of their multi stack dev system.
e
I know @lemon-agent-27707 has spoke about getting the service to understand stack references better because it does have a global view of all stacks and so can say "this stack is used by other stacks so don't delete it". Worth raising an ask at https://github.com/pulumi/pulumi-cloud-requests/issues
l
We do have an issue open add the concept of "protected stacks" similar to protected resources: https://github.com/pulumi/pulumi-cloud-requests/issues/48 Would you mind giving that a 👍 and adding a comment with any notes you might have?
b
Pulumi dung has an example of automation api with dependencies. So stand up stack A and it does B first then A. Destroy A and it destroys B first with approval prompts of course. Just automation api running over multiple stacks. https://github.com/gitfool/Pulumi.Dungeon