turbot/terraform_aws_compliance

Query: backup_plan_min_retention_35_days

Usage

powerpipe query terraform_aws_compliance.query.backup_plan_min_retention_35_days

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std -> 'rule') is null then 'alarm'
when (attributes_std -> 'rule' -> 'lifecycle') is null then 'ok'
when (attributes_std -> 'rule' -> 'lifecycle' ->> 'delete_after')::int >=35 then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'rule') is null then ' retention period not set'
when (attributes_std -> 'rule' -> 'lifecycle') is null then ' retention period set to never expire'
else ' retention period set to ' || (attributes_std -> 'rule' -> 'lifecycle' ->> 'delete_after')::int
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_backup_plan';

Controls

The query is being used by the following controls: