turbot/aws_insights

Query: ecs_task_definitions_for_ecs_cluster

Usage

powerpipe query aws_insights.query.ecs_task_definitions_for_ecs_cluster

SQL

with list_all_task_definitions as (
select
distinct task_definition_arn as task_definition
from
aws_ecs_task
where
cluster_arn = $1
union
select
distinct task_definition as task_definition
from
aws_ecs_service
where
cluster_arn = $1
and account_id = split_part($1, ':', 5)
and region = split_part($1, ':', 4)
)
select
d.task_definition_arn as task_definition_arn
from
aws_ecs_task_definition as d
where
d.task_definition_arn in (
select
distinct task_definition
from
list_all_task_definitions
);