In a normal Pulumi program, we don't use the code in the destroy process. We look at what's in the stack and work out the order to remove resources.
To do what you want, you can use the Automation API, run the destroy method there and then once that's done you can run your custom code
m
miniature-leather-70472
03/04/2021, 1:18 PM
ok, makes sense, thanks
b
brave-planet-10645
03/04/2021, 1:23 PM
Just as an aside, you can have a "standard" pulumi program for the deployment and then just use the automation api to destroy if you wanted to do that