turbot/aws_insights

Query: s3_buckets_for_ec2_application_load_balancer

Usage

powerpipe query aws_insights.query.s3_buckets_for_ec2_application_load_balancer

SQL

select
b.arn as bucket_arn
from
aws_s3_bucket b,
aws_ec2_application_load_balancer as alb,
jsonb_array_elements(alb.load_balancer_attributes) attributes
where
alb.arn = $1
and attributes ->> 'Key' = 'access_logs.s3.bucket'
and b.name = attributes ->> 'Value';