How Do You Troubleshoot an Error Trying to Delete a VPC, Network Interface, or Subnet ID?

One (or more) of the following problems is applicable:

Problem scenario #1
You are trying to delete an network interface in AWS. But you get an error "You are not allowed to manage 'ela-attach' attachments." What should you do?

Problem scenario #2
You are trying to delete a subnet from AWS' VPC. But you get this error:

Note that the following subnets cannot be deleted: The following subnets contain one or more network interfaces, and cannot be deleted until those network interfaces have been deleted. Click here to view your network interfaces.    subnet-1234abcd | foobar

What should you do?

Possible Solution #1
Go to Lambda functions. In the "Configuration" tab of the function, search for the "VPC" section. Detach the relevant VPC. (This can easily prevent the deletion of a Network Interface or Subnet.)

Possible Solution #2
Remove unused VPC links from the API gateway.

Possible Solution #3
Remove unused VPC Endpoint services.

Possible Solution #4
Remove unused NAT gateways.

Possible Solution #5
Remove unused ECS/EKS clusters.

Possible Solution #6
Remove unused load balancers.

Possible Solution #7
Remove unused Elastic IP addresses (go to EC2 -> Network & Security).

Possible Solution #8
Remove unused Route Tables.

Possible Solution #9
Remove unnecessary Internet Gateways

Possible Solution #10
Remove unnecessary Endpoints.

Possible Solution #11
Remove unnecessary Peering Connections

Citation: Possible solutions #2 through 6 came from this posting.

Leave a comment

Your email address will not be published. Required fields are marked *