turbot/aws_insights

Query: cloudwatch_log_groups_for_redshift_cluster

Usage

powerpipe query aws_insights.query.cloudwatch_log_groups_for_redshift_cluster

SQL

with redshift_clusters as (
select
arn,
title,
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
), cloudwatch_log_groups as (
select
title,
arn,
region,
account_id
from
aws_cloudwatch_log_group
)
select
g.arn as log_group_arn
from
redshift_clusters as c,
cloudwatch_log_groups as g
where
g.title like '%' || c.title || '%';