turbot/aws_thrifty
Loading controls...

Control: Old EBS snapshots should be deleted if not required

Description

Old EBS snapshots are likely unnecessary and costly to maintain.

Usage

Run the control in your terminal:

powerpipe control run aws_thrifty.control.ebs_snapshot_max_age

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_thrifty.control.ebs_snapshot_max_age --share

Steampipe Tables

Params

ArgsNameDefaultDescriptionVariable
$1ebs_snapshot_age_max_days
90
The maximum number of days snapshots can be retained.

SQL

select
arn as resource,
case
when start_time > (current_timestamp - ($1 :: int || ' days') :: interval) then 'ok'
else 'alarm'
end as status,
snapshot_id || ' created at ' || start_time || '.' as reason,
region,
account_id
from
aws_ebs_snapshot;

Tags