turbot/terraform_aws_compliance

Query: redshift_cluster_maintenance_settings_check

Usage

powerpipe query terraform_aws_compliance.query.redshift_cluster_maintenance_settings_check

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std -> 'allow_version_upgrade') is null and (attributes_std -> 'automated_snapshot_retention_period') is null then 'alarm'
when (attributes_std -> 'allow_version_upgrade') is null and (attributes_std -> 'automated_snapshot_retention_period')::integer >= 7 then 'ok'
when (attributes_std -> 'allow_version_upgrade')::bool and (attributes_std -> 'automated_snapshot_retention_period')::integer >= 7 then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'allow_version_upgrade') is null and (attributes_std -> 'automated_snapshot_retention_period') is null then ' does not have the required maintenance settings'
when (attributes_std -> 'allow_version_upgrade') is null and (attributes_std -> 'automated_snapshot_retention_period')::integer >= 7 then ' has the required maintenance settings'
when (attributes_std -> 'allow_version_upgrade')::bool and (attributes_std -> 'automated_snapshot_retention_period')::integer >= 7 then ' has the required maintenance settings'
else ' does not have the required maintenance settings'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_redshift_cluster';

Controls

The query is being used by the following controls: