When I try to delete my Application Load Balancer, I receive a "Failed to delete load balancer" error message.
Short description
When you try to delete an Application Load Balancer, you might receive one of the following error messages:
"Error: "Failed to delete load balancer: You cannot delete 'arn:aws:elasticloadbalancing:region:1234567891012:loadbalancer/app/myALB/123456789012' since it is registered as a target of one or more target groups. To delete this target, you must first deregister it from all target groups.""
"Error: "Failed to delete load balancer: Load balancer 'arn:aws:elasticloadbalancing:region:1234567891012:loadbalancer/app/myALB/123456789012' cannot be deleted because deletion protection is enabled.""
Resolution
Important: To prevent accidental disruption, make sure that the load balancer doesn't actively manage traffic within your organization before you delete it.
Troubleshoot "deregister it from all target groups" errors
The "deregister" error typically occurs if your Application Load Balancer is or was the target of a Network Load Balancer. You might get this error even after you delete the Network Load Balancer that sent traffic to your Application Load Balancer.
To resolve this issue, make sure that your Application Load Balancer isn't associated with a target group that has the Application Load Balancer target type. Complete the following steps:
- Open the Amazon Elastic Compute Cloud (Amazon EC2) console.
- In the navigation pane, choose Target Groups.
- In the search bar, choose the Target type filter. Set the filter to equal (=) for the Application Load Balancer.
- If the load balancer is associated with a target group, then deregister the Application Load Balancer from the target group. Or, if you don't use the target group, then delete the target group.
- Delete the Application Load Balancer.
Troubleshoot "delete protection is enabled" errors
If you activated deletion protection, then you can't delete the load balancer. To resolve this issue, deactivate delete protection. Then, delete the Application Load Balancer.