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달 전338회 조회
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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠