Control: Classic load balancers having no instances attached should be deleted
Description
Classic load balancers with no instances attached still cost money should be deleted.
Usage
Run the control in your terminal:
powerpipe control run aws_thrifty.control.ec2_classic_lb_unused
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_thrifty.control.ec2_classic_lb_unused --share
Steampipe Tables
SQL
select arn as resource, case when jsonb_array_length(instances) > 0 then 'ok' else 'alarm' end as status, case when jsonb_array_length(instances) > 0 then title || ' has registered instances.' else title || ' has no instances registered.' end as reason , region, account_idfrom aws_ec2_classic_load_balancer;