turbot/aws_insights

Query: cloudformation_stacks_for_sns_topic

Usage

powerpipe query aws_insights.query.cloudformation_stacks_for_sns_topic

SQL

select
s.id as stack_id
from
aws_sns_topic as t,
aws_cloudformation_stack as s,
jsonb_array_elements(
case jsonb_typeof(notification_arns)
when 'array' then (notification_arns)
else null end
) n
where
t.topic_arn = trim((n::text ), '""')
and t.topic_arn = $1
and t.account_id = split_part($1, ':', 5)
and t.region = split_part($1, ':', 4);