turbot/gcp_thrifty
GitHub
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:

steampipe check gcp_thrifty.control.compute_snapshot_max_age

Snapshot and share results via Steampipe Cloud:

steampipe login
steampipe check --share gcp_thrifty.control.compute_snapshot_max_age

Plugins & Tables

Params

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

SQL

select
self_link as resource,
case
when date_part('day', now() - creation_timestamp) > $1 then 'alarm'
else 'ok'
end as status,
name || ' created on ' || creation_timestamp || ' (' || date_part('day', now() - creation_timestamp) || ' days).' as reason,
location,
project
from
gcp_compute_snapshot;

Tags