turbot/aws_insights

Query: iam_roles_with_direct_attached_policy

Usage

powerpipe query aws_insights.query.iam_roles_with_direct_attached_policy

Steampipe Tables

SQL

with role_attached_compliance as (
select
arn,
case
when jsonb_array_length(attached_policy_arns) > 0 then 'with policies'
else 'no policies'
end as has_attached
from
aws_iam_role
)
select
has_attached,
count(*)
from
role_attached_compliance
group by
has_attached;

Dashboards

The query is used in the dashboards: