turbot/aws_insights

Query: efs_file_system_by_age

Usage

powerpipe query aws_insights.query.efs_file_system_by_age

Steampipe Tables

SQL

with file_systems as (
select
title,
creation_time,
to_char(creation_time, 'YYYY-MM') as creation_month
from
aws_efs_file_system
),
months as (
select
to_char(d, 'YYYY-MM') as month
from
generate_series(
date_trunc('month',
(
select
min(creation_time)
from file_systems
)
),
date_trunc('month', current_date),
interval '1 month'
) as d
),
file_systems_by_month as (
select
creation_month,
count(*)
from
file_systems
group by
creation_month
)
select
months.month,
file_systems_by_month.count
from
months
left join file_systems_by_month on months.month = file_systems_by_month.creation_month
order by
months.month;

Dashboards

The query is used in the dashboards: