turbot/azure_insights

Query: network_subnets_for_network_interface

Usage

powerpipe query azure_insights.query.network_subnets_for_network_interface

SQL

select
lower(s.id) as subnet_id
from
azure_network_interface as ni,
jsonb_array_elements(ip_configurations) as c
left join azure_subnet as s on lower(s.id) = lower(c -> 'properties' -> 'subnet' ->> 'id')
where
lower(ni.id) = $1
and ni.subscription_id = split_part($1, '/', 3)
and lower(s.id) is not null;