This is likely happening because there are still rules associated with the load balancer that are using the target group. Unfortunately there is currently on way in the AWS console to view or edit the rules. Here is another approach:
- Install AWS cli: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
- If you have different profiles, add
--profile=name_of_profile
on each of the following commands aws elbv2 describe-load-balancer
, get the load balancer arnaws elbv2 describe-listeners --load-balancer-arn arn:aws:elasticloadbalancing:this_is_the_load_balancer_arn
, get listener arn for the listener which you associated with the target groupaws elbv2 describe-rules --listener-arn arn:aws:elasticloadbalancing:this_is_the_listener_arn
, get the rule arn which should contain the name of the target group you are looking to removeaws elbv2 delete-rule --rule-arn arn:aws:elasticloadbalancing:this_is_the_rule_arn
You should now be able to return to the AWS console and successfully delete the target group as it is no longer associated with the load balancer.