turbot/tailpipe-mod-aws-cost-usage-report-insights

Query: overview_dashboard_accounts_input

Usage

powerpipe query aws_cost_and_usage_insights.query.overview_dashboard_accounts_input

SQL

with account_ids as (
select
distinct on(line_item_usage_account_id)
line_item_usage_account_id ||
case
when line_item_usage_account_name is not null then ' (' || coalesce(line_item_usage_account_name, '') || ')'
else ''
end as label,
line_item_usage_account_id as value
from
aws_cost_and_usage_report
order by label
)
select
'All' as label,
'all' as value
union all
select
label,
value
from
account_ids;