Control: ECS instances with very low CPU utilization should be reviewed
Resize or eliminate underutilized instances.
steampipe check alicloud_thrifty.control.ecs_instance_with_low_utilization
Plugins & Tables
|$1||ecs_instance_avg_cpu_utilization_low||The average CPU utilization required for instances to be considered infrequently used. This value should be lower than ecs_instance_avg_cpu_utilization_high.|
|$2||ecs_instance_avg_cpu_utilization_high||The average CPU utilization required for instances to be considered frequently used. This value should be higher than ecs_instance_avg_cpu_utilization_low.|
with ec2_instance_utilization as (selectinstance_id,round(cast(sum(maximum)/count(maximum) as numeric), 1) as avg_max,count(maximum) daysfromalicloud_ecs_instance_metric_cpu_utilization_dailywheredate_part('day', now() - timestamp) <=30group byinstance_id)selectarn as resource,casewhen avg_max is null then 'error'when avg_max < $1 then 'alarm'when avg_max < $2 then 'info'else 'ok'end as status,casewhen avg_max is null then 'Cloud monitor metrics not available for ' || title || '.'else title || ' is averaging ' || avg_max || '% max utilization over the last ' || days || ' days.'end as reason,region,account_idfromalicloud_ecs_instance as ileft join ec2_instance_utilization as u on u.instance_id = i.instance_id;