Control: Long running instances should be reviewed
Description
Instances should ideally be ephemeral and rehydrated frequently, check why these instances have been running for so long.
Usage
Run the control in your terminal:
powerpipe control run gcp_thrifty.control.compute_instance_long_running
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run gcp_thrifty.control.compute_instance_long_running --share
Steampipe Tables
Params
Args | Name | Default | Description | Variable |
---|---|---|---|---|
$1 | compute_running_instance_age_max_days |
| The maximum number of days instances are allowed to run. |
SQL
select self_link as resource, case when date_part('day', now() - creation_timestamp) > $1 then 'info' else 'ok' end as status, title || ' has been running for ' || date_part('day', now() - creation_timestamp) || ' day(s).' as reason , location, projectfrom gcp_compute_instancewhere status in ('PROVISIONING', 'STAGING', 'RUNNING','REPAIRING');