turbot/alicloud_thrifty

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

steampipe check alicloud_thrifty.control.ecs_instance_long_running

Plugins & Tables

SQL

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

Tags