turbot/azure_insights

Query: network_subnets_for_network_security_group

Usage

powerpipe query azure_insights.query.network_subnets_for_network_security_group

SQL

select
lower(s.id) as subnet_id
from
azure_network_security_group as nsg,
jsonb_array_elements(subnets) as sub
left join azure_subnet as s on lower(s.id) = lower(sub ->> 'id')
where
lower(nsg.id) = $1
and nsg.subscription_id = split_part($1, '/', 3)
and lower(s.id) is not null;