turbot/aws_insights

Query: ec2_application_load_balancers_for_s3_bucket

Usage

powerpipe query aws_insights.query.ec2_application_load_balancers_for_s3_bucket

SQL

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