turbot/guardrails_insights

Query: stacks_aggregate

Usage

powerpipe query guardrails_insights.query.stacks_aggregate

Steampipe Tables

SQL

select
case
when control_type_uri = 'tmod:@turbot/aws#/control/types/accountStack' then 'AWS > Account > Stack'
when control_type_uri = 'tmod:@turbot/aws-iam#/control/types/iamStack' then 'AWS > IAM > Stack'
when control_type_uri = 'tmod:@turbot/aws#/control/types/regionStack' then 'AWS > Region > Stack'
when control_type_uri = 'tmod:@turbot/aws-vpc-core#/control/types/vpcStack' then 'AWS > VPC > VPC > Stack'
end as "Stack",
count(*) as "Total",
sum(
case
when state in ('error') then 1
else 0
end
) as "Error",
sum(
case
when state in ('invalid') then 1
else 0
end
) as "Invalid",
sum(
case
when state in ('tbd') then 1
else 0
end
) as "TBD"
from
guardrails_control as c
where
control_type_uri IN (
'tmod:@turbot/aws#/control/types/accountStack',
'tmod:@turbot/aws-iam#/control/types/iamStack',
'tmod:@turbot/aws#/control/types/regionStack',
'tmod:@turbot/aws-vpc-core#/control/types/vpcStack'
)
group by
"Stack";

Dashboards

The query is used in the dashboards: