turbot/steampipe-mod-terraform-aws-compliance

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_check

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_aws_compliance.control.elb_lb_target_group_use_health_check --share

SQL

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_line
from
terraform_resource
where
type in ('aws_lb_target_group', 'aws_alb_target_group');

Tags