turbot/steampipe-mod-terraform-aws-compliance

Control: ElastiCache Redis cluster automatic backup should be enabled with retention period of 15 days or greater

Description

When automatic backups are enabled, Amazon ElastiCache creates a backup of the cluster on a daily basis. The backup can be retained for a number of days as specified by your organization. Automatic backups can help guard against data loss.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.elasticache_redis_cluster_automatic_backup_retention_15_days

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'snapshot_retention_limit')::int < 15 then 'alarm'
else 'ok'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'snapshot_retention_limit')::int is null then ' automatic backups disabled'
when (attributes_std -> 'snapshot_retention_limit')::int < 15 then ' automatic backup retention period is less than 15 days'
else ' automatic backup retention period is more than 15 days'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_elasticache_replication_group';

Tags