1 Answer
- Newest
- Most votes
- Most comments
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
Relevant content
- asked 3 years ago
- asked 2 years ago
- asked 2 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 10 months ago
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?