turbot/aws_insights

Query: ecs_container_instances_for_ecs_service

Usage

powerpipe query aws_insights.query.ecs_container_instances_for_ecs_service

SQL

select
i.arn as container_instance_arn
from
aws_ecs_service as s
left join aws_ecs_container_instance as i on s.cluster_arn = i.cluster_arn
left join aws_ec2_instance as e on i.ec2_instance_id = e.instance_id
where
i.arn is not null
and s.arn = $1
and s.account_id = split_part($1, ':', 5)
and s.region = split_part($1, ':', 4);