Impossible to delete VPC / Network Interface

0

HELLO everyone, I have created a VPC on eu-north-1 in order to follow a tutorial. Now, I don't need it anymore, and I have trouble deleting it.

I know it is connected to a network ACL and a subnet, but it seems impossible to detach it from either subnet or network ACL.

Here is what I get: Enter image description here Enter image description here

I got the same error even if I got to the network ACL page.

Anyone can help, please?

Thank you, Tahiry

Tahiry
已提問 9 個月前檢視次數 342 次
8 個答案
3
已接受的答案

Here are some of common cases:

  • Active load balancer that was attached to the ENIs
  • Active RDS instances
  • DMS Replication Instance
  • VPC links from API gateway
  • VPC Endpoint services
  • Unused NAT gateways
  • Unused ECS/EKS clusters

You'd need to delete these resources first based on what's applicable in your case. Note that these are just few common services, where we see this attached but there can be others too.

See, where are your security groups being used, can you detach security groups from those resources first, then try deleting the security groups first, if you see issues removing security groups, remove inbound/outbound rules from the security groups, then try deleting the security groups and then ENIs

Additional command references:

  1. aws ec2 delete-network-interface --network-interface-id <eni-name>

  2. aws ec2 describe-network-interfaces --filters 'Name=vpc-id,Values='$vpc | grep NetworkInterfaceId

Also, if you have support plan, I'd suggest you to reach out to AWS Support by logging a case under Technical category. They are well equipped to address the issue in a precise way if none of the above helps.

Hope you find this helpful.

Comment here if you have additional questions, happy to help.

Abhishek

profile pictureAWS
專家
已回答 9 個月前
profile pictureAWS
專家
iBehr
已審閱 9 個月前
2

Hello.
I think the network interface is being used by other services and therefore cannot be deleted.
First, we need to identify what service the ENI is used for.
Please check the ENI's Description for clues that may identify some services.

profile picture
專家
已回答 9 個月前
profile picture
專家
已審閱 9 個月前
  • This can be confirmed by selecting Network Interface → ENI from the Management Console. The following image is an ENI for Lambda, but the description may include details that identify the service. lambda

  • Run the following command to see the ENI description.

    aws ec2 describe-network-interfaces\
     --filters Name=subnet-id,Values="subnet-id"\
     --query 'NetworkInterfaces[].{
         PrivateIpAddress:PrivateIpAddress,
         PublicIp:Association.PublicIp
         Name:TagSet[?Key==`Name`]|[0].Value,
         Description:Description,
         InstanceId:Attachment.InstanceId,
         NetworkInterfaceId:NetworkInterfaceId,
         Status:Status
     }'\
     --output table
    
  • From ENI's description, it seems that they have tied Lambda to the VPC. First, remove the VPC settings for that Lambda. If the Lambda is not needed, the entire Lambda can be deleted. If the ENI status changes from in-use after that, it can be deleted. https://repost.aws/knowledge-center/lambda-eni-find-delete

0

here it is Riku, subnet-dependencies

Tahiry
已回答 9 個月前
0

I think it is connected to a lambda,

Description AWS Lambda VPC ENI-sam-spring-SamSpringApplication-lnVfK9xEpuZT-d2007dad-7a8b-4608-82f4-dac984ccc67d

Right ?

Tahiry
已回答 9 個月前
  • Yes. I believe it is the ENI used by Lambda. So, you must first delete the Lambda VPC configuration or remove the Lambda if it is not needed.

0

Hey Riku, thanks for your answer, It is connected to 2 subnets. I think you are referring to the details panel here right? Enter image description here

But it couldn't be deleted from subnet

Tahiry
已回答 9 個月前
0

There is no pannel to detach it from subnet as well,

subnet-association

Tahiry
已回答 9 個月前
0

Thanks, secondabhi, Is there any AWS CLI command to list VPC or Network interface dependencies, please

Tahiry
已回答 9 個月前
0

Thank you so much for all your support, it was solved

Tahiry
已回答 9 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南