Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS not able to delete network interface

In AWS, i have network interfaces, which i am not able to delete, because they are supposedly in use. I have tried detaching them by the force option, but that deid not work.

How am i able to identify the object the network interface uses?

like image 521
David Avatar asked Sep 07 '25 13:09

David


1 Answers

The best way to find the resource which a network interface is attached to is checking the 'Description' field of the ENI.

Depending on the resource type this Description field could change. Some examples I get from my environment are:

  • DMS: "DMSNetworkInterface"
  • ElastiCache: "ElastiCache node-name"
  • ALB: "ELB app/alb-name/auto-id"
  • NLB: "ELB net/nlb-name/auto-id"
  • Nat Gateway: "Interface for NAT Gateway nat-id"
  • Transit Gateway Attachment: "Network Interface for Transit Gateway Attachment tgw-attach-id"
  • RDS: "RDSNetworkInterface"
  • EC2 Instance: "Primary network interface" or can be empty too. For this resource type the fields 'Instance details' contains the information.
  • VPC Endpoint: "VPC Endpoint Interface vpce-id"
  • Lambda: "AWS Lambda VPC ENI-lambda_name-id"
  • ECS Task: "ecs-attachment-arn"
  • etc

So checking the value of this field you can identify on most case the resource which use that ENI.

like image 84
OARP Avatar answered Sep 10 '25 02:09

OARP