https://pulumi.com logo
#aws
Title
# aws
h

hundreds-receptionist-31352

01/29/2021, 1:54 PM
Hi, is there any way to run some pulumi code only when the event "destroy" is running? I would like to detect this "event" to run an extra code.
w

witty-candle-66007

01/29/2021, 2:41 PM
There isn’t anything implicit to tell your code it’s a destroy - in fact, your code doesn’t really run on destroy since Pulumi is pretty much just deleting the resources. If you need to manage the destroy, you can leverage the automation api sdk (https://www.pulumi.com/blog/tag/automation-api/) to orchestrate things.