Control: DocDB cluster backup retention period should be at least 7 days
Description
This control checks whether DocDB cluster backup retention is set to 7 or greater than 7.
Usage
Run the control in your terminal:
powerpipe control run terraform_aws_compliance.control.docdb_cluster_backup_retention_period_7
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_aws_compliance.control.docdb_cluster_backup_retention_period_7 --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std -> 'backup_retention_period') is null then 'alarm' when ((attributes_std ->> 'backup_retention_period'))::int >= 7 then 'ok' else 'alarm' end as status, split_part(address, '.', 2) || case when (attributes_std -> 'backup_retention_period') is null then ' backup retention not set' else ' backup retention set to ' || (attributes_std ->> 'backup_retention_period') end || '.' as reason , path || ':' || start_linefrom terraform_resourcewhere type = 'aws_docdb_cluster';