turbot/aws_insights

Query: s3_buckets_for_redshift_cluster

Usage

powerpipe query aws_insights.query.s3_buckets_for_redshift_cluster

SQL

with redshift_clusters as (
select
arn,
logging_status,
region,
account_id
from
aws_redshift_cluster
where
account_id = split_part($1, ':', 5)
and region = split_part($1, ':', 4)
and arn = $1
order by
arn,
title,
region,
account_id
), s3_buckets as (
select
name,
arn,
region,
account_id
from
aws_s3_bucket
)
select
b.arn as bucket_arn
from
redshift_clusters as c,
s3_buckets as b
where
b.name = c.logging_status ->> 'BucketName';