AWS will not delete your VPC because a network interface is still there
Delete VPC lists resources you must delete or terminate firstShort answer
A VPC cannot be deleted while a requester-managed network interface exists in it. An AWS service owns that interface, so you cannot detach or delete it by hand. Find the owner in the interface description, delete that resource (NAT gateway, load balancer, endpoint, RDS), then delete the VPC.
Fix it fast
1Find out which cause you have
List the network interfaces that an AWS service created on your behalf. The Description column names the owner.
aws ec2 describe-network-interfaces \ --filters "Name=requester-managed,Values=true" \ --query "NetworkInterfaces[*].[Description, InterfaceType]" \ --output table2Match what you see, then jump to its fix
- 1
Description such as VPC Endpoint Interface, or a NAT gateway, load balancer or RDS nameA requester-managed interface belongs to a service that still existsFix - 2
The interface is no longer in use but is still listedAn interface was left behind, detached, after its service was deletedFix - 3
The console lists resources you must delete or terminate before the VPC can goInstances and gateways still exist in the VPCFix
- 1
What does the error look like?
Delete VPC lists resources you must delete or terminate firstA network interface owned by an AWS service cannot be detached or modified by you
Cause 1 of 3
A requester-managed interface belongs to a service that still exists
1Check
Requester-managed interfaces are created by an AWS service, for example a DB instance from RDS, a NAT gateway or an interface endpoint. You cannot detach or modify them yourself.
aws ec2 describe-network-interfaces --filters "Name=requester-managed,Values=true" --query "NetworkInterfaces[*].[NetworkInterfaceId, Description]" --output table2Fix
Delete or terminate the resource the description points to. The service then detaches and deletes its interface for you.
# Delete the resource named in the Description: the NAT gateway, load balancer,
# interface endpoint or DB instance, in that service's own console or CLI.3Verify
The interface no longer appears in the list.
aws ec2 describe-network-interfaces --filters "Name=requester-managed,Values=true"Confirmed by docs.aws.amazon.com
Cause 2 of 3
An interface was left behind, detached, after its service was deleted
1Check
If a service detached an interface but did not delete it, you can delete the detached interface yourself.
aws ec2 describe-network-interfaces --network-interface-ids eni-0123456789abcdef0 --query "NetworkInterfaces[0].Status"2Fix
Delete the detached interface. An interface must be detached before it can be deleted.
aws ec2 delete-network-interface --network-interface-id eni-0123456789abcdef03Verify
The command prints nothing on success; list the interfaces to confirm.
aws ec2 describe-network-interfaces --network-interface-ids eni-0123456789abcdef0Confirmed by docs.aws.amazon.com
Cause 3 of 3
Instances and gateways still exist in the VPC
1Check
Before deleting a VPC, terminate EC2 instances and delete load balancers, NAT gateways, transit gateway attachments and interface endpoints. The console shows the blocking resources.
aws ec2 describe-network-interfaces --filters Name=vpc-id,Values=vpc-0123456789abcdef0 --query "NetworkInterfaces[*].[NetworkInterfaceId, Description]" --output table2Fix
Remove each blocker, then delete the VPC in the console, which also removes its subnets, route tables and similar parts.
aws ec2 delete-vpc --vpc-id vpc-0123456789abcdef03Verify
The VPC is gone from the list.
aws ec2 describe-network-interfaces --filters Name=vpc-id,Values=vpc-0123456789abcdef0Confirmed by docs.aws.amazon.com
How do I stop it coming back?
- Tear down stacks in reverse order: services first, then network.
- Manage VPC resources in CloudFormation or Terraform so a stack delete removes them in the right order.
- Tag everything with the project name so leftover interfaces are easy to trace.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
- RaheebA consumer app shipped to both stores from one Flutter codebase on a .NET and Azure back end.
- Loade DriverThe driver side of a delivery platform: live jobs, routing and earnings, past 5K Google Play downloads.
Related fixes
Servers
AWS will not detach or delete an internet gateway
Deleting an internet gateway fails while it is attached to a VPC
An internet gateway cannot be deleted while it is attached to a VPC, and it cannot be detached while the VPC still has resources with public IP addresses or Elastic IP addresses.
2 causes, each with a fixServers
Status code 460 on an AWS Application Load Balancer
elb_status_code 460 in ALB access logs
A 460 is generated by the load balancer, not by your app.
3 causes, each with a fixServers
Application Load Balancer returns 504 for requests to EC2 instances
HTTPCode_ELB_504_Count
A 504 from an Application Load Balancer means it could not get an answer from a target in time.
4 causes, each with a fixServers
Apache has a certificate, but https:// does not open
No line with :443 in the output of ss -ltnp
HTTPS needs four things at once: mod_ssl loaded, Apache listening on 443, a virtual host on 443 with SSLEngine on, and a firewall that lets 443 in.
4 causes, each with a fixServers
aws emr --steps fails: Error parsing parameter, Expected '=', received 'EOF'
Error parsing parameter '--steps': Expected: '=', received: 'EOF' for input:
The AWS CLI tried to read your option as shorthand key=value pairs and ran out of text where it expected an equals sign.
3 causes, each with a fixServers
AWS CLI says you must specify a region
You must specify a region. You can also configure your region by running "aws configure".
The AWS CLI sends every request to one region and has none to use.
4 causes, each with a fix