I’d like to create a custom component resource that on creation performs some api calls and builds a thing on a website. If the calls are successful I’d like to publish an arbitrary resource in the pulumi state to track this resource. On pulumi destroy, or on destroy of the specific component resource, I’d like specific actions to be performed (An API call is executed to delete the resource, the arbitrary resource is deleted from pulumi state).
Can anyone link me to some docs around handling the lifecycle of a custom component resource that’s built without using an already published provider?
Lets say the class is called ClusterConnection, and it integrates my k8s cluster with a ci cd system by calling the cicd service’s API. I would have a clusterconnection resource in my pulumi state, and on destruction of that pulumi stack or resource it would perform a custom api call to delete the object and then it would remove the object from state