I am trying to delete aws vpc (a non default one). I am getting error that \"We could not delete the following VPC (vpc-xxxxxxx (xx.xx.xx.x/16)) Network interface \'eni-xxxx
As @karimtabet said, the VPC I was unable to delete was still assigned to an active RDS instance. after removing this RDS instance, I was able to delete the VPC.
Check if you have any EFS instances or S3 buckets with versioning turned on or cross-domain replication (this is the one that got me recently).
You were right..It was ECS issue in my case. Not letting me delete my ENIs saying I dont have the permissions. I had already deregistered my ECS task definition but still It was not letting me delete resources like VPC, ENIs created by ECS.
I had to update the version of task definition under ECS using same resources as previous definition version and then I deleted that new service and then deleted the clustere.
With clustere, it deleted all resource like VPC, ENIs which it was not letting me delete earlier.
I then dergistered second version of task definition. I had two inactive tasks definitions for a monent and then one task definitions disappeared..now only one is there in inactive state.
That network interface could be connected to a security group which is then connected to another Amazon product like ElastiCache (or anything). It's connected to something which may be connected to something else.
I solve this by deleting active load balancer that was attached to the ENIs. You can check active load balancers on EC2 > Load Balancing > Load Balancers
A running ECS task could be an issue, try to stop/delete the same. https://forums.aws.amazon.com/thread.jspa?threadID=114301