- Newest
- Most votes
- Most comments
In rare cases, it may take some time for the ENI to disappear.
If you wait a day or two and the ENI does not disappear, I think it is best to contact AWS Support.
Inquiries under "Account and billing" can be made free of charge.
Please inquire from the URL below.
https://console.aws.amazon.com/support
Just in case someone falls into the same trouble I found out through AWS Ticket (Case ID 174073153000545) that the ENI was stuck because IAM Role (ECS Infraestructure Role) was deleted before AWS could delete the ENI itself.
Basically I needed to re-create just the IAM Infraestructure Role and let it there some time (because AWS keeps trying to remove the ENI "continuously"). After some hours the ENI was deleted and I was able to remove all the others components (VPC, route table, subnets, etc) using terraform destroy again.
This is a common issue when trying to delete resources that have dependencies, especially with Elastic Network Interfaces (ENIs) that were created by AWS services like ECS. Even after deleting the parent resource (in this case, the ECS cluster), sometimes the ENIs can remain stuck in an "in-use" state. Here are some steps you can try:
-
Wait a bit longer: Although you've already waited 12 hours, in rare cases, it can take up to 24-48 hours for all resources to be fully released.
-
Double-check for any remaining ECS resources: Ensure that all ECS tasks, services, and the cluster itself have been completely removed.
-
Check for other AWS services: Sometimes, other services like NAT Gateways, Load Balancers, or VPC Endpoints might be using the ENI. Make sure all such resources have been deleted.
-
Use AWS CLI or SDK to get more information: You can use commands to describe the network interfaces and get more details about what might be using them.
-
Try force detaching the ENI: In some cases, you might be able to force detach the ENI using the AWS CLI or SDK.
If none of these steps work, your best option is to contact AWS Support. Even if you don't have a paid support plan, you can still open a case under the "Account and Billing" category for free. Explain the situation, provide the ENI ID, and mention that you've already deleted the ECS cluster but the ENI remains stuck. AWS support should be able to manually release the orphaned ENI for you.
Remember, it's important not to try deleting resources like VPCs, subnets, or security groups while there are still ENIs attached, as this can lead to further complications. Focus on resolving the ENI issue first, and then the other resources should be deletable.
Sources
Unable to Delete Stuck Network Interface (ENI) After ELB Deletion – Need AWS Intervention | AWS re:Post
The network interface can't be deleted | AWS re:Post
Cannot delete network interface | AWS re:Post
Unable to delete network interface | AWS re:Post
Relevant content
- asked 4 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
