Control: DynamoDB table should be protected by backup plan
Description
Ensure that AWS DynamoDB tables are protected by a backup plan. The rule is non-compliant if the DynamoDB Table is not covered by a backup plan.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.dynamodb_table_protected_by_backup_planSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.dynamodb_table_protected_by_backup_plan --shareSQL
This control uses a named query:
with backup_protected_table as (  select    resource_arn as arn  from    aws_backup_protected_resource as b  where    resource_type = 'DynamoDB')select  t.arn as resource,  case    when b.arn is not null then 'ok'    else 'alarm'  end as status,  case    when b.arn is not null then t.title || ' is protected by backup plan.'    else t.title || ' is not protected by backup plan.'  end as reason    , t.region, t.account_idfrom  aws_dynamodb_table as t  left join backup_protected_table as b on t.arn = b.arn;