turbot/alicloud_thrifty
Loading controls...

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 alicloud_thrifty.control.ecs_instance_long_running

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run alicloud_thrifty.control.ecs_instance_long_running --share

Steampipe Tables

Params

ArgsNameDefaultDescriptionVariable
$1ecs_running_instance_age_max_days
90
The maximum number of days an instance are allowed to run.

SQL

select
arn as resource,
case
when date_part('day', now() - creation_time) > $1 then 'alarm'
else 'ok'
end as status,
title || ' has been running ' || date_part('day', now() - creation_time) || ' days.' as reason,
account_id,
region
from
alicloud_ecs_instance
where
status = 'Running';

Tags