I want to do some eni cleanup when security groups are being destroyed
b
I want to do some eni cleanup when security groups are being destroyed
💡 1
l
You can do this with a custom resource provider. Dynamic resource providers are the easiest to create. https://www.pulumi.com/docs/iac/concepts/resources/dynamic-providers/#deleteid-props
However I'm not certain that it will be called during a destroy. It will be called when a resource needs to be deleted during an
up
.
b
I think the real fix here is to figure out why I’m getting orphaned ENIs
l
Yes. I'm guessing you're not declaring them in code, that rarely happens. Are they associated with an EC2 instance, an LB, NAT, IG, or what?
e
Might also want to take a look at the new resource hooks: https://www.pulumi.com/blog/resource-hooks/ That lets you register a callback to run when resources are deleted
🙌 1
✅ 1
🎉 1
b
I’ve been waiting so long for this feature!
g
This has made my day! 🎉 🎉 🎉 🎉