0 votes
1 view
in AWS by (9.4k points)

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-xxxxxx' is currently in use. (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterValue; Request ID: xxxxxx-dd86-47c8-98cd-xxxxxxxxxxx)".

When I tried deleting the related Network Interface, I got error "eni-xxxxxxx: You do not have permission to access the specified resource."

There are security groups associated with the NI (network interface). There are subnets associated with the NI. There are no EC2 instances - all are terminated. There are no VPC endpoints. There are no RDS db, db security group or subnets.

For EC2 SG (security groups), I am getting permission denied error message while trying to delete (even the non default SG against the non-default VPC. This SG has description of "AWS created security group for d-xxxxxxxxxx directory controllers".

For subnets, I am not able to delete them because they are associated with the above mentioned NI.

Can someone help? I have a free tier account and hence even dont have technical support or neither able to post new thread in aws forums (getting error message - Your account is not ready for posting messages yet. Please try again later). I fear this is because I have a free tier account.

1 Answer

+1 vote
by (18.6k points)
selected by
 
Best answer

1. Make sure you don't have Elastic IP address associated with any resources inside the VPC you are trying to delete. if there is, then remove that elastic IP address then try deleting your VPC.

2. Also check if there is any ELB created in the VPC. Again, if there is, then delete it and then try deleting your VPC.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...