turbot/aws_insights

Query: sqs_queues_for_s3_bucket

Usage

powerpipe query aws_insights.query.sqs_queues_for_s3_bucket

SQL

select
q.queue_arn as queue_arn
from
aws_s3_bucket as b,
jsonb_array_elements(
case
jsonb_typeof(
event_notification_configuration -> 'QueueConfigurations'
)
when 'array' then (
event_notification_configuration -> 'QueueConfigurations'
)
else null
end
) as t
left join aws_sqs_queue as q on q.queue_arn = t ->> 'QueueArn'
where
q.queue_arn is not null
and b.arn = $1;