turbot/aws_insights

Query: ec2_target_groups_for_ecs_service

Usage

powerpipe query aws_insights.query.ec2_target_groups_for_ecs_service

SQL

select
t.target_group_arn as target_group_arn
from
aws_ecs_service as s,
jsonb_array_elements(load_balancers) as l
left join aws_ec2_target_group as t on t.target_group_arn = l ->> 'TargetGroupArn'
where
s.arn = $1
and s.account_id = split_part($1, ':', 5)
and s.region = split_part($1, ':', 4);