turbot/aws_thrifty
Loading controls...

Control: Redshift cluster with low CPU utilization should be reviewed

Description

Resize or eliminate under utilized clusters.

Usage

Run the control in your terminal:

powerpipe control run aws_thrifty.control.redshift_cluster_low_utilization

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_thrifty.control.redshift_cluster_low_utilization --share

Steampipe Tables

Params

ArgsNameDefaultDescriptionVariable
$1redshift_cluster_avg_cpu_utilization_low
20
The average CPU utilization required for clusters to be considered infrequently used. This value should be lower than redshift_cluster_avg_cpu_utilization_high.
$2redshift_cluster_avg_cpu_utilization_high
35
The average CPU utilization required for clusters to be considered frequently used. This value should be higher than redshift_cluster_avg_cpu_utilization_low.

SQL

with redshift_cluster_utilization as (
select
cluster_identifier,
round(cast(sum(maximum) / count(maximum) as numeric), 1) as avg_max,
count(maximum) days
from
aws_redshift_cluster_metric_cpu_utilization_daily
where
date_part('day', now() - timestamp) <= 30
group by
cluster_identifier
)
select
i.cluster_identifier as resource,
case
when avg_max is null then 'error'
when avg_max < $1 then 'alarm'
when avg_max < $2 then 'info'
else 'ok'
end as status,
case
when avg_max is null then 'CloudWatch metrics not available for ' || title || '.'
else title || ' is averaging ' || avg_max || '% max utilization over the last ' || days || ' days.'
end as reason,
region,
account_id
from
aws_redshift_cluster as i
left join redshift_cluster_utilization as u on u.cluster_identifier = i.cluster_identifier;

Tags