turbot/digitalocean_thrifty

GitHub
Loading controls...

Control: Block storage volume snapshots created over 90 days ago should be deleted if not required

Description

Old snapshots are likely unneeded and costly to maintain.

Usage

Run the control in your terminal:

steampipe check digitalocean_thrifty.control.block_storage_volume_snapshot_age_90

Snapshot and share results via Steampipe Cloud:

steampipe login
steampipe check --share digitalocean_thrifty.control.block_storage_volume_snapshot_age_90

Plugins & Tables

SQL

select
a.id as resource,
case
when a.created_at > current_timestamp - interval '90 days' then 'ok'
else 'alarm'
end as status,
a.title || ' has been created for ' || date_part('day', now() - a.created_at) || ' day(s).' as reason,
r.name as region
from
digitalocean_snapshot a,
jsonb_array_elements_text(regions) as region
left join digitalocean_region as r on r.slug = region
where
a.resource_type = 'volume';

Tags