turbot/aws_insights

Query: s3_buckets_for_codebuild_project

Usage

powerpipe query aws_insights.query.s3_buckets_for_codebuild_project

SQL

select
s3.arn as s3_bucket_arn
from
aws_codebuild_project as p,
aws_s3_bucket as s3
where
p.account_id = split_part($1, ':', 5)
and p.region = split_part($1, ':', 4)
and p.arn = $1
and (s3.name = split_part(p.cache ->> 'Location', '/', 1)
or s3.name = p.artifacts ->> 'Location'
or s3.name = split_part(p.logs_config -> 'S3Logs' ->> 'Location', '/', 1)
or s3.name = split_part(p.source ->> 'Location', '/', 1)
);