turbot/steampipe-mod-terraform-aws-compliance

Control: Auto Scaling groups with a load balancer should use health checks

Description

The Elastic Load Balancer (ELB) health checks for Amazon Elastic Compute Cloud (Amazon EC2) Auto Scaling groups that support maintenance of adequate capacity and availability.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.autoscaling_group_with_lb_use_health_check

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'load_balancers') is null and (attributes_std -> 'target_group_arns') is null then 'alarm'
when (attributes_std ->> 'health_check_type') <> 'ELB' then 'alarm'
else 'ok'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'load_balancers') is null and (attributes_std -> 'target_group_arns') is null then ' not associated with a load balancer'
when (attributes_std ->> 'health_check_type') <> 'ELB' then ' does not use ELB health check'
else ' uses ELB health check'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_autoscaling_group';

Tags