- Newest
- Most votes
- Most comments
This is a common issue that can occur when trying to delete network interfaces (ENIs) associated with Lambda functions. Even if you've deleted the Lambda function, the ENI may still appear to be in use. Here are some steps you can take to resolve this:
-
Wait for automatic deletion: Lambda typically deletes the ENI automatically, but this process can take up to an hour or even 20 minutes in some cases. Try waiting and then attempt to delete the ENI again.
-
Use the Lambda ENI Finder: AWS provides a tool called the Lambda ENI Finder that can help identify which Lambda functions or versions might be using the network interface. Run this tool to check for any associations.
-
Check for old Lambda versions: Sometimes, inactive versions of Lambda functions can still reference the subnets. Go through your Lambda functions in the AWS Console and delete any old versions that might be affected.
-
Verify event source mappings: Check if any event source mappings from services like Amazon MSK, self-managed Kafka, Amazon MQ, or Amazon DocumentDB are using the ENI.
-
Force detach using AWS CLI: If the above steps don't work, you can try to force detach the network interface using the AWS CLI command:
aws ec2 detach-network-interface --attachment-id <attachment-id> --force
Note that this may not work for Lambda-managed attachments.
-
Check VPC configuration: If you recently updated a function to remove its VPC configuration, Lambda may require up to 20 minutes to delete the attached Hyperplane ENI.
If none of these steps resolve the issue, it may be worth contacting AWS Support for further assistance, as there could be an underlying issue specific to your account or setup.
Sources
Unable to Delete network interface due link with Lambda | AWS re:Post
How I can delete a network interface that is connected with lambda function that does not exist anymore | AWS re:Post
Cant delete ENI | AWS re:Post
Deleting orphan Lambda Network Interfaces | AWS re:Post
Hello Aayush, Did you fix now ? If not, can you explain more about the problem, please ?
Hi Anjal, I am not able to resolve the issue. I tried this also https://www.youtube.com/watch?v=fYEPvvyRZIg while running ./findEniAssociations --eni <**> --region ap-south-1 Getting this, No Lambda functions or versions found that were using the same subnet as this ENI. If this ENI is not deleted automatically in the next 24 hours then it may be 'stuck'. If the ENI will not allow you to delete it manually after 24 hours then please contact AWS support and send them the output of this script.
Tried force detaching also, but no success. this I am getting - An error occurred (OperationNotPermitted) when calling the DetachNetworkInterface operation: You are not allowed to manage 'ela-attach' attachments.
Hello, if the output doesn't list any functions or function versions, then check whether the following services in your account use the network interface:
- Amazon Managed Streaming for Apache Kafka (Amazon MSK)
- Self-managed Apache Kafka
- Amazon ActiveMQ
- Amazon RabbitMQ
- Amazon DocumentDB
And follow the below documentation:
[+] https://repost.aws/knowledge-center/lambda-eni-find-delete
If even this doesn't help, feel free to reach out to AWS Support and they can internally help you remove the ENIs.
Hi, I would really like if AWS Support can help me in this and delete this internally. I am ok to provide the eni's of Network Interfaces.
Kindly refrain from sharing these information publicly due to security and privacy concern of your AWS Account. Instead, open a support case from the AWS account where the Elastic Network Interfaces (ENIs) are located. A support engineer will be able to assist you with your specific situation.
[+] https://docs.aws.amazon.com/awssupport/latest/user/case-management.html
Hello,
I have this issue in my account, and nothing seems to work (24 hours has passed since the Lambda was deleted).
Here's my problem: I don't have a support plan, and as such, I can't "open a support case" as is the recommended next step from a number of posts on this issue. How do folks like myself go about telling AWS about a problem with the system?
Thanks.
Relevant content
- asked a year ago
- asked 18 days ago
- AWS OFFICIALUpdated 2 years ago