As we don't have dynamic resource provides in .NET...
# dotnet
As we don't have dynamic resource provides in .NET, is there a way to detect when a stack is being destroyed? My scenario is that we've implemented a
that adds some database entries. I'd like to remove those entries if the resource is being destroyed. I'm pretty sure that the answer, if there is one, is that something will need to be executed outside of the
derived class.
I've looked at
but that only has
. Nothing to indicate if the stack is being destroyed.
If you use automation api you can subscribe to engine events and check for a delete/destroy action against a specific resource so that you can do something. But no, there is not a way to do this in your Pulumi program itself.
👍 1