turbot/steampipe-mod-terraform-aws-compliance

Control: EFS file systems should be in a backup plan

Description

To help with data back-up processes, ensure your Amazon Elastic File System (Amazon EFS) file systems are a part of an AWS Backup plan.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.efs_file_system_automatic_backups_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_aws_compliance.control.efs_file_system_automatic_backups_enabled --share

SQL

This control uses a named query:

select
address as resource,
case
when name in (select split_part((attributes_std ->> 'file_system_id')::text, '.', 2) from terraform_resource where type = 'aws_efs_backup_policy' and (attributes_std -> 'backup_policy' ->> 'status')::text = 'ENABLED') then 'ok' else 'alarm'
end as status,
split_part(address, '.', 2) || case
when name in (select split_part((attributes_std ->> 'file_system_id')::text, '.', 2) from terraform_resource where type = 'aws_efs_backup_policy' and (attributes_std -> 'backup_policy' ->> 'status')::text = 'ENABLED') then ' backup policy enabled'
else ' backup policy disabled'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_efs_file_system';

Tags