turbot/gcp_insights

Query: compute_forwarding_rules_for_compute_subnetwork

Usage

powerpipe query gcp_insights.query.compute_forwarding_rules_for_compute_subnetwork

SQL

select
r.id::text as rule_id
from
gcp_compute_forwarding_rule r,
gcp_compute_subnetwork s
where
s.id = (split_part($1, '/', 1))::bigint
and s.project = split_part($1, '/', 2)
and split_part(r.subnetwork, 'subnetworks/', 2) = s.name
union
select
r.id::text as rule_id
from
gcp_compute_global_forwarding_rule r,
gcp_compute_subnetwork s
where
s.id = (split_part($1, '/', 1))::bigint
and s.project = split_part($1, '/', 2)
and split_part(r.subnetwork, 'subnetworks/', 2) = s.name;