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:
powerpipe control run digitalocean_thrifty.control.droplet_long_runningSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run digitalocean_thrifty.control.droplet_long_running --shareSteampipe Tables
SQL
select d.urn as resource, case when date_part('day', now() - d.created_at) > $1 and status = 'off' then 'alarm' when date_part('day', now() - d.created_at) > $1 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;
Params
| Args | Name | Default | Description | Variable |
|---|---|---|---|---|
| $1 | droplet_age_max_days | | The maximum number of days droplets are allowed to run. |