medikoo / serverless-plugin-vpc-eni-cleanup

Cleanup of VPC network interfaces on stage removal
MIT License
20 stars 9 forks source link

Prevents node from exiting if removal fails #10

Closed perrin4869 closed 2 years ago

perrin4869 commented 2 years ago

For example, if the CF stack didn't exist. This is because https://github.com/medikoo/serverless-plugin-vpc-eni-cleanup/blob/69afe39d3e73c74b1070305507362e490a41fc62/index.js#L16 never gets triggered. Is there a hook to listen to in case remove fails?

medikoo commented 2 years ago

@perrin4869 that's a good point.

I think it can be solved by adding error hook with same logic. Such hook was introduced with v2.58 of Framework so it's possible to run logic if any of the hooks logic crashes

PR's welcome!

perrin4869 commented 2 years ago

Done!