AWS - Can't detaching network interfaces - You are not allowed to manage 'ela-attach' attachments

Blake Rivell picture Blake Rivell · Jul 5, 2019 · Viewed 25.9k times · Source

I did the AWS mysfits 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].

Answer

Nebulastic picture Nebulastic · Dec 3, 2019

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:

  • Remove unused VPC links from API gateway
  • Remove unused VPC Endpoint services
  • Remove unused NAT gateways
  • Remove unused ECS/EKS clusters
  • Remove unused load balancers
  • Remove unused EFS mounts

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.