nebari icon indicating copy to clipboard operation
nebari copied to clipboard

[BUG] - AWS ingress load balancer not removed on Nebari destroy

Open sblair-metrostar opened this issue 2 years ago • 3 comments

Describe the bug

Running nebari destroy on an AWS environment will consistently fail to delete network resources due to the ingress load balancer being abandoned.

Expected behavior

All resources associated with the Nebari environment should be deleted on nebari destroy

OS and architecture in which you are running Nebari

Ubuntu Linux, x64

How to Reproduce the problem?

Run nebari destroy on an AWS environment. The VPC will fail to be destroyed unless the load balancer is deleted manually while waiting.

Command output

image

Versions and dependencies used.

Kubernetes: 1.24 Nebari: 2023.7.2.dev

Compute environment

AWS

Integrations

No response

Anything else?

I assume this behavior would apply to other clouds as well, but only able to test this in AWS.

Workaround:

  1. Run nebari destroy on an AWS environment
  2. Wait until the EKS cluster/node groups are destroyed
  3. Find and manually delete the ingress load balancer
  4. Allow the destroy to finish. May timeout if you wait too long.

sblair-metrostar avatar Aug 18 '23 20:08 sblair-metrostar

Tying this to #1806.

iameskild avatar Sep 04 '23 23:09 iameskild

this still seems to be an issue (2025.6.1, well technically a dev enhancement to this version). i have had to manually delete the load balancer and the vpc.

satra avatar Jun 14 '25 13:06 satra

The primary issue was the inherent dependency on the AWS provider when creating the network resource within its module. When making it expects a specific order, but when performing the destruction, the order changes, and terraform is unable to properly handle that, which leads to a lingering destroy process, usually due to a NAT gateway or LB restricting the subnets to be decoupled and removed.

A proper solution would require completely remodeling that part of the network module. We've had a few ideas, but keeping backwards compatibility is the main issue.

viniciusdc avatar Jun 28 '25 18:06 viniciusdc