turbot/alicloud_insights

Query: ecs_security_group_unassociated

Usage

powerpipe query alicloud_insights.query.ecs_security_group_unassociated

SQL

with associated_sg as (
select
distinct group_id
from
alicloud_ecs_network_interface,
jsonb_array_elements_text(security_group_ids) as group_id
where
group_id = $1
)
select
case when a.group_id is null then 'Unassociated' else 'Associated' end as value,
'Network Interface' as label,
case when a.group_id is null then 'alert' else 'ok' end as type
from
alicloud_ecs_security_group s
left join associated_sg a on s.security_group_id = a.group_id
where
s.security_group_id = $1;

Dashboards

The query is used in the dashboards: