turbot/alicloud_thrifty
Loading controls...

Control: Old snapshots should be deleted if not required

Description

Old snapshots are likely unneeded and costly to maintain.

Usage

Run the control in your terminal:

powerpipe control run alicloud_thrifty.control.ecs_snapshot_max_age

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run alicloud_thrifty.control.ecs_snapshot_max_age --share

Steampipe Tables

Params

ArgsNameDefaultDescriptionVariable
$1ecs_snapshot_age_max_days
90
The maximum number of days a snapshot can be retained.

SQL

select
'acs:acs:' || region || ':' || account_id || ':' || 'snapshot/' || snapshot_id as resource,
case
when date_part('day', now() - creation_time) < $1 then 'ok'
else 'alarm'
end as status,
snapshot_id || ' created at ' || creation_time || ' (' || date_part('day', now() - creation_time) || ' days).' as reason,
account_id,
region
from
alicloud_ecs_snapshot;

Tags