How do you use Pulumi to destroy resources like CloudFront distributions (which need to be disabled before they can be destroyed) that require other operations to be preformed before they can be removed. I cannot seem to find a way to add custom destroy logic to a Pulumi stack. Does anyone have experience doing this? (Stackoverflow question here: https://stackoverflow.com/questions/55730860/custom-pulumi-destroy-logic)
04/17/2019, 3:36 PM
There is not yet a first-class feature for adding custom logic to resource deletion.
That said, I have not seen issues destroying CloudFront distributions in the past. What specifically are the "other operations" you need to do prior to deleting it in your case?
04/17/2019, 3:38 PM
@fierce-carpet-95079 can you post the specific error as well? The error had to do with not being able to destroy an enabled cloudfront distro.
04/17/2019, 4:08 PM
So sorry! We were acutally able to track down the issue to a statefile/reality miss-match. Sorry for the false alarm. We are though experiencing an issue with the destruction sequencing. Such as the bucket destroy fails because the bucket objects are not deleted yet. A second run of the destroy removes all the failed resources but I was wondering how we needed to declare it to get proper sequencing.