Run cloud function / custom automation on tenant deletion
Jelle den Burger
With the new automated tenant deletion it's great that I can automatically get rid of my tenant. But I would like to also run some automation upon tenant deletion. Specifically for resources that are part of the tenant, but running in another tenant.
For example, I might have a hub & spoke networking tenant elsewhere and I want to delete the relevant "spoke" that was used for the about-to-be deleted tenant.
Doing so with a cloud function would be sufficient.
J
Johannes Rudolph
Just to give everyone who has expressed in this a heads up on what the current alternative solution landscape looks like, while we keep this request on our mind.
Building blocks can be added to tenants as mandatory and do receive dedicated lifecycle events for provisioning and deprovisioning. This is the preferred method of modelling scenarios like spoke networks. You can find our reference implementation for this use case here https://hub.meshcloud.io/platforms/azure/definitions/azure-spoke-network
Building blocks must be deleted before tenant deprovisioning completes, so they offer a convenient way to insert custom deprovisioning logic into this process.
One major gap we plan to close for this solution is https://meshcloud.canny.io/feature-requests/p/automatically-delete-building-blocks-on-tenant-project-deletion, so please keep an eye on this.
Once this has shipped and we have received feedback on the building block approach we will reconsider the need for dedicated cloud functions/custom automations and are looking to your feedback on this matter.
Jelle den Burger
Merged in a post:
Hook into deletion of projects
Felix
I have build up a GitOps pipeline for deploying additional baseline services into Azure Subscriptions and GCP Projects. I hook into those pipelines by landing zone cloud functions, that commit files into a git repo.
I have another cloud funciton that deletes the documents created by the cloud function that meshStack already uses. I need meshStack to run this second cloud founction before meshStack cancel the subscription or the project.
Solution idea: Provide a webhook that fires when a project is deleted.