turbot/aws_insights

Query: dynamodb_table_autoscaling_disabled_count

Usage

powerpipe query aws_insights.query.dynamodb_table_autoscaling_disabled_count

SQL

with table_with_autoscaling as (
select
t.resource_id as resource_id,
count(t.resource_id) as count
from
aws_appautoscaling_target as t
where
service_namespace = 'dynamodb'
group by
t.resource_id
)
select
count(*) as value,
'Autoscaling Disabled' as label,
case
count(*)
when 0 then 'ok'
else 'alert'
end as type
from
aws_dynamodb_table as d
left join table_with_autoscaling as t on concat('table/', d.name) = t.resource_id
where
t.resource_id is null
or t.count < 2;

Dashboards

The query is used in the dashboards: