Control: DynamoDB table auto scaling should be enabled
Description
AWS DynamoDB auto scaling uses the AWS Application Auto Scaling service to adjust provisioned throughput capacity that automatically responds to actual traffic patterns.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.dynamodb_table_auto_scaling_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.dynamodb_table_auto_scaling_enabled --share
SQL
This control uses a named query:
with table_with_autocaling 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 d.arn as resource, case when d.billing_mode = 'PAY_PER_REQUEST' then 'ok' when t.resource_id is null then 'alarm' when t.count < 2 then 'alarm' else 'ok' end as status, case when d.billing_mode = 'PAY_PER_REQUEST' then d.title || ' on-demand mode enabled.' when t.resource_id is null then d.title || ' autoscaling not enabled.' when t.count < 2 then d.title || ' auto scaling not enabled for both read and write capacity.' else d.title || ' autoscaling enabled for both read and write capacity.' end as reason , d.region, d.account_idfrom aws_dynamodb_table as d left join table_with_autocaling as t on concat('table/', d.name) = t.resource_id;