Automation API allows writing arbitrary logic as a part of your updates. You can do all sorts of post deployment steps such as database migrations, liveness checks, etc.
This is only available as an alpha in the Go SDK for the time being:
https://github.com/pulumi/pulumi/issues/3901#issuecomment-685803282
We plan on delivering across languages after the alpha and feedback period. If this is something you'd be interested in please let us know.