turbot/steampipe-mod-aws-compliance

Control: ECS services should be attached to a load balancer

Description

ECS service can be configured to use Elastic Load Balancing to distribute traffic evenly across the tasks in your service. It is recommended to use Application Load Balancers for your AWS ECS services so that you can take advantage of these latest features, unless your service requires a feature that is only available with Network Load Balancers or Classic Load Balancers.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.ecs_service_load_balancer_attached

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.ecs_service_load_balancer_attached --share

SQL

This control uses a named query:

select
arn as resource,
case
when jsonb_array_length(load_balancers) = 0 then 'alarm'
else 'ok'
end as status,
case
when jsonb_array_length(load_balancers) = 0 then title || ' has no load balancer attached.'
else title || ' has ' || jsonb_array_length(load_balancers) || ' load balancer(s) attached.'
end as reason
, region, account_id
from
aws_ecs_service;

Tags