turbot/digitalocean_thrifty

GitHub
Loading controls...

Control: Droplets created over 90 days ago should be reviewed

Description

Droplets created over 90 days ago should be reviewed and deleted if not required.

Usage

Run the control in your terminal:

steampipe check digitalocean_thrifty.control.droplet_long_running

Snapshot and share results via Steampipe Cloud:

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

Plugins & Tables

SQL

select
d.urn as resource,
case
when date_part('day', now() - d.created_at) > 90
and status = 'off' then 'alarm'
when date_part('day', now() - d.created_at) > 90 then 'info'
else 'ok'
end as status,
case
when date_part('day', now() - d.created_at) > 90
and d.status = 'off' then d.title || ' instance status is ' || d.status || ', has been launced for ' || date_part('day', now() - created_at) || ' day(s).'
else d.title || ' has been launced for ' || date_part('day', now() - d.created_at) || ' day(s).'
end as reason,
r.name as region
from
digitalocean_droplet as d
left join digitalocean_region as r on r.slug = d.region_slug;

Tags