turbot/gcp_insights

Query: kubernetes_clusters_for_pubsub_topic

Usage

powerpipe query gcp_insights.query.kubernetes_clusters_for_pubsub_topic

SQL

with pubsub_topic as (
select
self_link,
project
from
gcp_pubsub_topic
where
project = split_part($1, '/', 6)
and self_link = $1
)
select
c.id::text || '/' || c.project as cluster_id
from
gcp_kubernetes_cluster c,
pubsub_topic t
where
c.notification_config is not null
and t.project = c.project
and t.self_link like '%' || (c.notification_config -> 'pubsub' ->> 'topic') || '%';