[BUG] - AWS ingress load balancer not removed on Nebari destroy
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
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:
- Run
nebari destroyon an AWS environment - Wait until the EKS cluster/node groups are destroyed
- Find and manually delete the ingress load balancer
- Allow the destroy to finish. May timeout if you wait too long.
Tying this to #1806.
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.
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.