turbot/gcp_insights

Query: kms_keys_for_pubsub_topic

Usage

powerpipe query gcp_insights.query.kms_keys_for_pubsub_topic

SQL

with kms_key as (
select
self_link
from
gcp_kms_key
), pubsub_topic as (
select
self_link,
kms_key_name
from
gcp_pubsub_topic
where
kms_key_name <> ''
and kms_key_name is not null
and project = split_part($1, '/', 6)
and self_link = $1
)
select
k.self_link
from
pubsub_topic p,
kms_key k
where
k.self_link like '%' || p.kms_key_name;