turbot/oci_insights

Query: identity_groups_without_users_count

Usage

powerpipe query oci_insights.query.identity_groups_without_users_count

SQL

with user_group as (
select
jsonb_array_elements(user_groups) ->> 'groupId' as g_id
from
oci_identity_user
)
select
count(*) as value,
'Without Users' as label,
case
when count(*) = 0 then 'ok'
else 'alert'
end as type
from
oci_identity_group
where
id not in (
select
distinct g_id
from
user_group
);

Dashboards

The query is used in the dashboards: