turbot/steampipe-mod-terraform-aws-compliance

Control: Neptune cluster backup retention period should be at least 7 days

Description

This control checks whether Neptune 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.neptune_cluster_backup_retention_period_7

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_aws_compliance.control.neptune_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_line
from
terraform_resource
where
type = 'aws_neptune_cluster';

Tags