turbot/aws_insights

Query: dynamodb_table_backup_plan_protection_status

Usage

powerpipe query aws_insights.query.dynamodb_table_backup_plan_protection_status

SQL

with backup_protected_table as (
select
resource_arn as arn
from
aws_backup_protected_resource as b
where
resource_type = 'DynamoDB'
),
table_backup_plan_protection_status as (
select
t.name as table_name,
case
when b.arn is not null then 'protected'
else 'unprotected'
end as backup_plan_protection_status
from
aws_dynamodb_table as t
left join backup_protected_table as b on t.arn = b.arn
)
select
backup_plan_protection_status,
count(*) as table_count
from
table_backup_plan_protection_status
group by
backup_plan_protection_status;

Dashboards

The query is used in the dashboards: