turbot/steampipe-mod-terraform-aws-compliance

Control: Amazon Redshift clusters should have automatic snapshots enabled

Description

This control checks whether Amazon Redshift clusters have automated snapshots enabled. It also checks whether the snapshot retention period is greater than or equal to seven.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.redshift_cluster_automatic_snapshots_min_7_days

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'automated_snapshot_retention_period') is null then 'ok'
when (attributes_std -> 'automated_snapshot_retention_period')::integer > 7 then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'automated_snapshot_retention_period') is null then ' ''automated_snapshot_retention_period'' set to 1 day by default'
when (attributes_std -> 'automated_snapshot_retention_period')::integer > 7 then ' ''automated_snapshot_retention_period'' set to ' || (attributes_std ->> 'automated_snapshot_retention_period')::integer || ' day(s)'
else ' ''automated_snapshot_retention_period'' set to 0 days'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_redshift_cluster';

Tags