turbot/aws_compliance

Query: ec2_instance_protected_by_backup_plan

Usage

powerpipe query aws_compliance.query.ec2_instance_protected_by_backup_plan

SQL

with backup_protected_instance as (
select
resource_arn as arn
from
aws_backup_protected_resource as b
where
resource_type = 'EC2'
)
select
i.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 i.title || ' is protected by backup plan.'
else i.title || ' is not protected by backup plan.'
end as reason
, i.region, i.account_id
from
aws_ec2_instance as i
left join backup_protected_instance as b on i.arn = b.arn;

Controls

The query is being used by the following controls: