turbot/aws_insights

Query: ec2_instance_age_table

Usage

powerpipe query aws_insights.query.ec2_instance_age_table

SQL

select
i.instance_id as "Instance ID",
i.tags ->> 'Name' as "Name",
now()::date - i.launch_time::date as "Age in Days",
i.launch_time as "Launch Time",
i.instance_state as "State",
a.title as "Account",
i.account_id as "Account ID",
i.region as "Region",
i.arn as "ARN"
from
aws_ec2_instance as i,
aws_account as a
where
i.account_id = a.account_id
order by
i.launch_time,
i.instance_id;

Dashboards

The query is used in the dashboards: