[Solved] Community interface is in use by one other service in AWS

If in case you have tried to delete a Safety Group, or VPC, or numerous different sources and also you get the dreaded Community interface is in use by one other service error, then you’ll be able to resolve this by deleting the useful resource by the API.

The right way to delete the Community Interface (ENI)

aws ec2 delete-network-interface --network-interface-id eni-xxxxx

Exchange the eni-xxxxx with the ENI id that you’re struggling to delete.

The right way to discover what companies are utilizing the ENI

aws ec2 describe-internet-gateways --filters 'Title=attachment.vpc-id,Values='$vpc | grep InternetGatewayId
aws ec2 describe-subnets --filters 'Title=vpc-id,Values='$vpc | grep SubnetId
aws ec2 describe-route-tables --filters 'Title=vpc-id,Values='$vpc | grep RouteTableId
aws ec2 describe-network-acls --filters 'Title=vpc-id,Values='$vpc | grep NetworkAclId
aws ec2 describe-vpc-peering-connections --filters 'Title=requester-vpc-info.vpc-id,Values='$vpc | grep VpcPeeringConnectionId
aws ec2 describe-vpc-endpoints --filters 'Title=vpc-id,Values='$vpc | grep VpcEndpointId
aws ec2 describe-nat-gateways --filter 'Title=vpc-id,Values='$vpc | grep NatGatewayId
aws ec2 describe-security-groups --filters 'Title=vpc-id,Values='$vpc | grep GroupId
aws ec2 describe-instances --filters 'Title=vpc-id,Values='$vpc | grep InstanceId
aws ec2 describe-vpn-connections --filters 'Title=vpc-id,Values='$vpc | grep VpnConnectionId
aws ec2 describe-vpn-gateways --filters 'Title=attachment.vpc-id,Values='$vpc | grep VpnGatewayId
aws ec2 describe-network-interfaces --filters 'Title=vpc-id,Values='$vpc | grep NetworkInterfaceId
See also  Tao of React with Alex Kondov

Leave a Reply