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
demandé il y a 9 mois342 vues
8 réponses
3
Réponse acceptée

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
EXPERT
répondu il y a 9 mois
profile pictureAWS
EXPERT
iBehr
vérifié il y a 9 mois
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
EXPERT
répondu il y a 9 mois
profile picture
EXPERT
vérifié il y a 9 mois
  • 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
répondu il y a 9 mois
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
répondu il y a 9 mois
  • 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
répondu il y a 9 mois
0

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

subnet-association

Tahiry
répondu il y a 9 mois
0

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

Tahiry
répondu il y a 9 mois
0

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

Tahiry
répondu il y a 9 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions

Contenus pertinents