turbot/gcp_insights

Query: logging_buckets_for_storage_bucket

Usage

powerpipe query gcp_insights.query.logging_buckets_for_storage_bucket

SQL

with logging_bucket as (
select
name
from
gcp_logging_bucket
), storage_bucket as (
select
id,
log_bucket
from
gcp_storage_bucket
where
id = split_part($1, '/', 1)
and project = split_part($1, '/', 2)
and log_bucket is not null
)
select
l.name as bucket_name
from
storage_bucket b,
logging_bucket l
where
b.log_bucket = l.name;