amazon-ec2aws-elb

Unable to delete Application Load Balancer (AWS)


I get the following error when I try to delete an ALB:

You cannot delete 'arn:aws:elasticloadbalancing:XXXXX' 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.

Then when I try to delete the listeners, I get this error:

Listener port '22' is in use by registered target 'arn:XXXX' and cannot be removed.

Hope you guys could teach me so I can delete this ALB. Thank you


Solution

  • Try the instructions here: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-delete.html

    These are the steps to delete an Application Load Balancer:

    1. If you have a CNAME record for your domain that points to your load balancer, point it to a new location and wait for the DNS change to take effect before deleting your load balancer.
    2. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
    3. On the navigation pane, under LOAD BALANCING, choose Load Balancers.
    4. Select the load balancer, and then choose Actions, Delete.
    5. When prompted for confirmation, choose Yes, Delete.

    Good Luck!