turbot/steampipe-mod-aws-insights

Dashboard: AWS DynamoDB Table Dashboard

This dashboard answers the following questions:

  • How many tables are in each account and region?
  • How many table items are in each account and region?
  • How many unencrypted and unused tables are there?
  • How many tables don't have auto-scaling, continuous backups and backup protection enabled?
  • How much do my tables cost each month?
  • What are my most used tables by read and write throughput?
This dashboard contains 5 cards and 1 table.

Usage

Install the mod:

mkdir dashboards
cd dashboards
powerpipe mod init
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights

Start the Powerpipe server:

steampipe service start
powerpipe server

Open http://localhost:9033 in your browser and select AWS DynamoDB Table Dashboard dashboard.

You could also snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe dashboard run aws_insights.dashboard.dynamodb_table_dashboard --share

Queries

This dashboard uses the the following queries:
with monthly_costs as (
select
period_start,
period_end,
case
when date_trunc('month', period_start) = date_trunc('month', CURRENT_DATE::timestamp) then 'Month to Date'
when date_trunc('month', period_start) = date_trunc('month', CURRENT_DATE::timestamp - interval '1 month') then 'Previous Month'
else to_char (period_start, 'Month')
end as period_label,
period_end::date - period_start::date as days,
sum(unblended_cost_amount)::numeric::money as unblended_cost_amount,
(sum(unblended_cost_amount) / (period_end::date - period_start::date ) )::numeric::money as average_daily_cost,
date_part('days', date_trunc ('month', period_start) + '1 MONTH'::interval - '1 DAY'::interval ) as days_in_month,
sum(unblended_cost_amount) / (period_end::date - period_start::date ) * date_part('days', date_trunc ('month', period_start) + '1 MONTH'::interval - '1 DAY'::interval )::numeric::money as forecast_amount
from
aws_cost_by_service_usage_type_monthly as c
where
service = 'Amazon DynamoDB'
and date_trunc('month', period_start) >= date_trunc('month', CURRENT_DATE::timestamp - interval '1 month')
group by
period_start,
period_end
)
select
period_label as "Period",
unblended_cost_amount as "Cost",
average_daily_cost as "Daily Avg Cost"
from
monthly_costs
union all
select
'This Month (Forecast)' as "Period",
(select forecast_amount from monthly_costs where period_label = 'Month to Date') as "Cost",
(select average_daily_cost from monthly_costs where period_label = 'Month to Date') as "Daily Avg Cost";

Tags