patrickchugh / terravision

Terravision creates Professional Cloud Architecture Diagrams from your Terraform code automatically. Supports AWS, Google and Azure.
Mozilla Public License 2.0
683 stars 67 forks source link

Target Group returned instead of load balancer #111

Open ludevrie opened 3 months ago

ludevrie commented 3 months ago

This happens in an ECS Fargate setup with internal and external ALB load balancers.

In graphmaker handle_special_resources() crashes when looking for "aws_lb". The reason is that in resource_handlers.aws_handle_lb() the variable in found_lbs (['aws_lb.elb']) contains the details of a target group instead of a load balancer. This in turn causes helpers.check_variant(lb, tfdata["meta_data"][lb]) to fail, because the meta_data contains neither "application" nor "network" and False is returned (which causes the crash, because on the next line it is concatenated with a string (renamed_node = lb_type + "." + "elb")