Can not remove or detach network interface

0

I used k8s, eks, cloudformation stacks etc.

Now I can't delete the remaining network interface EVEN under the root account. I read that I have to search for related resources, such as the VPC, routing tables etc., and try to delete them first. I tried. Most of them couldn't be deleted because they were complaining that the network interface exists haha :) I also try to detach it, but always got errors. I have no elastic IP attached. I spent like 3 hours trying to remove this network interface and its related resources, nothing helped so far. I also tried to use the aws cli but the same results. I'm just getting an error: Failed to detach the network interface. API error: "You do not have permission to access the specified resource." I also tried to use --force with cli, didn't help. I can't delete, and can't detach the interface no matter what I do.

What should I even do? To me it seems really weird that I can't do anything even from my root user.

AndyN
질문됨 6달 전339회 조회
1개 답변
0

Hello.

I think you need to delete the resource that is using the network interface.
For example, typical resources include ALB, Lambda connected to VPC, and EC2.
First you need to find the resource that uses ENI.
If you look at the ENI description column, there may be hints written there.

I think it will be easier to see if you run the following command with CloudShell etc.

SUBNETID=subnet-yyyyyyyyyy

aws ec2 describe-network-interfaces\
 --filters Name=subnet-id,Values="$SUBNETID"\
 --query 'NetworkInterfaces[].{
     PrivateIpAddress:PrivateIpAddress,
     PublicIp:Association.PublicIp
     Name:TagSet[?Key==`Name`]|[0].Value,
     Description:Description,
     InstanceId:Attachment.InstanceId,
     NetworkInterfaceId:NetworkInterfaceId,
     Status:Status
 }'\
  --output json\
  | jq -r '
    .[] | [.PrivateIpAddress, .PublicIp, .Description, .Name,  .InstanceId, .NetworkInterfaceId, .Status] | @csv'\
  | sort -V -t "," -k 1
profile picture
전문가
답변함 6달 전
  • I did check all the related resources and did try to delete them, as I mentioned in the post. Nothing helped.

  • By the way, which resource is the ENI linked to that cannot be deleted?

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

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

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

관련 콘텐츠