turbot/aws_compliance

Query: backup_plan_region_configured

Usage

powerpipe query aws_compliance.query.backup_plan_region_configured

SQL

with count_plans as (
select
region,
account_id,
count(*) as count
from
aws_backup_plan
group by
region,
account_id
)
select
'arn:' || r.partition || '::' || r.region || ':' || r.account_id as resource,
case
when cp.count > 0 then 'ok'
else 'alarm'
end as status,
case
when cp.count > 0 then cp.count || ' backup plan(s) exist in region ' || r.region || '.'
else 'No backup plans exist in region ' || r.region || '.'
end as reason,
r.region,
r.account_id
from
aws_region as r
left join count_plans as cp on r.account_id = cp.account_id
and r.region = cp.region;

Controls

The query is being used by the following controls: