hi everyone. A rather strange question - what do y...
# general
b
hi everyone. A rather strange question - what do you think about implementing a cascading resource deletion for
pulumi state delete
? Let's say I royally screwed up and ended up deleting some resource that has a lot of children, e.g. a k8s cluster. Now my Pulumi state is horribly broken as
pulumi state delete
isn't really helpful since there are far too many dependencies to walk the tree myself from down up. In this situation it would be really great to have
--yes-i-know-what-i-am-doing
flag to
pulumi state delete
to force the deletes to cascade. After all, my root resource is not there anymore and the resources in the state do not correlate with the actual infrastructure objects anyway. wdyt?
l
At first glance, a cascading delete would be very risky, but a protect-if-has-children opt would be very safe. And maybe some way to get Pulumi to generate a script full of all the
pulumi state delete
commands necessary to fully clean up, so that I can manually edit it myself..
m
Such a flag seems analogous to the
--target-dependents
flag for
pulumi up
. That flag allows the targeted deletion of a resource and anything that depends on that resource. I think that given the similarity in behavior there’s a pretty straightforward case to make here.
@billions-xylophone-85957 would you mind opening an issue in https://github.com/pulumi/pulumi to track your suggestion?
b
thanks!