is there a hook that one can use to be invoked jus...
# general
a
is there a hook that one can use to be invoked just before an actual update operation (not the preview phase) begins and just after it has (successfully) finished? (Background: I'd like to send out notifications at these points in time)
b
You can use our webhooks (if you're on one of our paying plans) for the after part. Otherwise for both before and after you'd want to use automation api. You can keep your standalone pulumi program (like this: https://github.com/pulumi/automation-api-examples/tree/main/nodejs/localProgram-tsnode - it doesn't have to be completely inline) but not run it with the Pulumi CLI, use the SDK instead
a
re webhooks: they can do only after, did I get that right? so I need the automation API ==> looking into that now
I looked into the sample - it seems this is like calling pulumi via the cmdline. but how would I know when pulumi actually starts to update? if I send my notification "saying update in progress, service down" before calling pulumi, then the notification is sent a lot earlier than need be because first pulumi does all the preparatory work (in my case that's not insignificant because a number of docker images are built) and only then it actually hits the cloud resources.
b
That's correct. Automation API is probably your best bet. Technically you could do it with a normal Pulumi program but you'd have to know the last thing being created and the first thing so you'd have to plan your program accordingly.
But I would do this with automation api