Dynamic provider is the way to do this right now. Pulumi doesn't currently support lifecycle hooks like you describe.
b
bored-oyster-3147
04/06/2021, 1:34 PM
I suppose you could use automation API and use the new structured logging to subscribe to pulumi engine events and depending on the event you could do some action. Haven’t explored that use case though
g
gentle-diamond-70147
04/06/2021, 6:13 PM
Yep, that sounds like a good option too. The value that you're storing or dropping would not have the same resource management lifecycle of a pulumi resource (with Create/Read/Update/Delete), but that might be okay for this use case.