Control: ELB HTTP HTTPS target group should be configured with Healthcheck
Description
Ensure HTTP HTTPS target group is defined with Healthcheck.
Usage
Run the control in your terminal:
powerpipe control run terraform_aws_compliance.control.elb_lb_target_group_use_health_checkSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_aws_compliance.control.elb_lb_target_group_use_health_check --shareSQL
This control uses a named query:
select  address as resource,  case    when (attributes_std ->> 'protocol') like any (array ['HTTPS', 'HTTP']) and (attributes_std ->> 'health_check') is not null then 'ok'    else 'alarm'  end status,  split_part(address, '.', 2) || case    when (attributes_std ->> 'protocol') like any (array ['HTTPS', 'HTTP']) and (attributes_std ->> 'health_check') is not null then ' target group configured with health check'    else ' target group not configured with health check'    end || '.' reason    , path || ':' || start_linefrom  terraform_resourcewhere  type in ('aws_lb_target_group', 'aws_alb_target_group');