turbot/alicloud_insights

Query: ecs_snapshot_age

Usage

powerpipe query alicloud_insights.query.ecs_snapshot_age

Steampipe Tables

SQL

with data as (
select
(extract(epoch from (select (now() - creation_time)))/86400)::int as age
from
alicloud_ecs_snapshot
where
arn = $1
and account_id = split_part($1, ':', 5)
and region = split_part($1, ':', 4)
)
select
'Age (in Days)' as label,
age as value,
case when age<35 then 'ok' else 'alert' end as type
from
data;

Dashboards

The query is used in the dashboards: