amazon-web-servicesamazon-ec2amazon-vpc

Can't detach network interfaces


I did the AWS misfits tutorial and I thought the cleanup would be as simple as deleting the Cloud Formation stack. However, items failed to delete so I am trying to clean them up manually to assist the Cloud Formation stack deletion.

I keep getting an error when trying to Detach the network interfaces (I am logged into the root account):

Error detaching network interfaces:

eni-0047gfhfgh8ab0e: You are not allowed to manage 'ela-attach' attachments.
eni-0f4a46hgfha757e: You are not allowed to manage 'ela-attach' attachments.

I am unable to delete my VPC without these being deleted.

The stack as a whole is failing to delete because of the following:

The following resource(s) failed to delete: [InternetGateway, PublicSubnetTwo, VPC, GatewayAttachement, PublicSubnetOne].


Solution

  • I had the same issue, which gave me the following message:

    enter image description here

    This could be because there is a service in use which still uses the network interface. You could try some of the following things:

    If that doesn't help, there is something wrong/stuck on the underlying OS, you should wait for it to resolve by itself or report it. I had an ENI deployed by a Lambda function after deleting the lambda function, the ENI got stuck. After some time I was able to detach the ENI.

    Update: for the people using the aws cli, AWS support posted a bash script and documentation to easily identify ENIs that are still hanging around somewhere (source).