turbot/aws_insights

Query: codebuild_projects_for_codecommit_repository

Usage

powerpipe query aws_insights.query.codebuild_projects_for_codecommit_repository

SQL

select
p.arn as codebuild_project_arn
from
aws_codecommit_repository as r
left join aws_codebuild_project as p on r.clone_url_http in (
select
source ->> 'Location' as "l"
from
aws_codebuild_project
union all
select
s ->> 'Location' as "l"
from
aws_codebuild_project,
jsonb_array_elements(aws_codebuild_project.secondary_sources) as s
)
where
p.arn is not null
and r.arn = $1
and r.region = split_part($1, ':', 4)
and r.account_id = split_part($1, ':', 5);