turbot/terraform_aws_compliance

Query: elb_application_network_gateway_lb_cross_zone_load_balancing_enabled

Usage

powerpipe query terraform_aws_compliance.query.elb_application_network_gateway_lb_cross_zone_load_balancing_enabled

Steampipe Tables

SQL

select
address as resource,
case
when ((attributes_std ->> 'load_balancer_type') = 'application' or (attributes_std ->> 'load_balancer_type') is null) and (attributes_std -> 'enable_cross_zone_load_balancing') is null then 'ok'
when (attributes_std ->> 'load_balancer_type') like any (array ['gateway', 'network']) and (attributes_std -> 'enable_cross_zone_load_balancing')::boolean then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'load_balancer_type') = 'application' and (attributes_std -> 'enable_cross_zone_load_balancing') is null then ' cross-zone load balancing enabled default for ' || (attributes_std ->> 'load_balancer_type') || ' type'
when (attributes_std ->> 'load_balancer_type') like any (array ['gateway', 'network']) and (attributes_std -> 'enable_cross_zone_load_balancing')::boolean then ' cross-zone load balancing enabled for ' || (attributes_std ->> 'load_balancer_type') || ' type'
else ' cross-zone load balancing disabled'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type in ('aws_alb', 'aws_lb');

Controls

The query is being used by the following controls: