turbot/aws_insights

Query: ecr_repositories_for_ecs_task_definition

Usage

powerpipe query aws_insights.query.ecr_repositories_for_ecs_task_definition

SQL

select
r.arn as repository_arn
from
aws_ecs_task_definition as td,
jsonb_array_elements(container_definitions) as d
left join aws_ecr_repository as r on r.repository_uri = split_part(d ->> 'Image', ':', 1)
where
r.arn is not null
and td.task_definition_arn = $1
and td.account_id = split_part($1, ':', 5)
and td.region = split_part($1, ':', 4);