turbot/azure_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 azure_thrifty.control.compute_snapshot_max_age

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run azure_thrifty.control.compute_snapshot_max_age --share

Steampipe Tables

Params

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

SQL

select
s.unique_id as resource,
case
when date_part('day', now() - time_created) < $1 then 'ok'
else 'alarm'
end as status,
s.title || ' created at ' || time_created || ' (' || date_part('day', now() - time_created) || ' days).' as reason,
s.resource_group,
display_name as subscription
from
azure_compute_snapshot as s,
azure_subscription as sub
where
sub.subscription_id = s.subscription_id;

Tags