Lambda in VPC won't create new ENI after an ENI has been manually detached from subnet

Mat*_*lan 7 amazon-web-services aws-lambda

I have run into a problem where my Lambda functions can no longer create new ENI's in a VPC subnet once an ENI has been detached and deleted from that subnet. I have reproduced this on two different VPC's and multiple subnets.

Here are the steps I used to reproduce this:

  1. Create a Lambda function and associate it with a VPC and a subnet.
  2. Execute the Lambda function which will cause it to create a new ENI in the subnet. The function is able to access an RDS database in the VPC.
  3. Manually detach and delete the ENI from the subnet.
  4. Execute the Lambda function again. No ENI will be created. Lambda function is unable to access RDS database.

I repeated these steps across multiple subnets in two VPC's and a now Lambda functions are unable to create new ENI's in any of those subnets.

似乎VPC子网永久无法使用Lambda函数创建新的ENI,但是让事情待了一整夜后,我今天早晨再次运行了该函数,并且能够创建ENI。AWS必须具有自动清理流程。即便如此,我仍然测试了分离和删除,然后回到Lambda函数不会创建新ENI的状态。

不知道这是怎么回事。分离ENI时,我没有选择“强制分离”。我究竟做错了什么?

Mat*_*lan 7

从我今天下午进行的研究来看,这似乎是Lambda函数在VPC中运行的局限性,并且已经使用了一年多。删除Lambda函数后,清理ENI会有六个小时的延迟。我手动分离和删除ENI使情况变得更糟,因为似乎ENI直到六个小时的延迟才真正被删除。手动删除似乎使ENI处于某种孤立状态,从而阻止在该子网中创建新的ENI,直到AWS清除了旧的ENI。

https://www.reddit.com/r/aws/comments/4fncrl/dangling_enis_after_deleting_an_invpc_lambda_with/

https://github.com/hashicorp/terraform/issues/5767

因此,目前看来,强制清除的唯一解决方案是删除ENI和它所在的子网。:-/

我让我的无服务器删除命令运行了很长时间(我没有通过手动删除ENI来加快速度),最终确实完成了,但是花了40分钟。ENI被抛在后面,但其他所有内容都被清理了。我想象在六个小时内ENI将消失。