Serverless Plugin VPC Eni Cleanup

Automatic cleanup of VPC network interfaces on stage removal

View on Github

Build status Tests coverage npm version


Cleanup of VPC network interfaces on stage removal

Removal of stage (so CloudFormation stack deletion) that involves VPC lambda functions is very slow.
"Waiting for NetworkInterfaces associated with the Lambda Function to be cleaned up" process takes usually around 40 minutes.

While the AWS team works on improving that, the workaround for a meantime is to remove those interfaces manually, so stack deletion finalizes in reasonable time.

This plugin removes all detected network interfaces in parallel to stack deletion process.


npm install serverless-plugin-vpc-eni-cleanup


Activate plugin in serverless.yml

  - serverless-plugin-vpc-eni-cleanup

Following IAM policy needs to be ensured for plugin to work without issues

  "Effect": "Allow",
  "Action": [
  "Resource": ["*"]

That's it. Having that, with every sls remove operation plugin will attempt to delete discovered network interfaces


npm test