turbot/gcp_insights

Query: compute_networks_for_sql_database_instance

Usage

powerpipe query gcp_insights.query.compute_networks_for_sql_database_instance

SQL

with sql_database_instance as (
select
self_link,
ip_configuration
from
gcp_sql_database_instance
where
self_link = $1
) select
n.id::text || '/' || project as network_id
from
sql_database_instance as i,
gcp_compute_network as n
where
split_part(i.ip_configuration->>'privateNetwork','networks/', 2) = n.name