turbot/aws_insights

Query: vpc_security_groups_for_ecs_service

Usage

powerpipe query aws_insights.query.vpc_security_groups_for_ecs_service

SQL

select
sg.group_id as group_id
from
aws_ecs_service as e,
jsonb_array_elements_text(e.network_configuration -> 'AwsvpcConfiguration' -> 'SecurityGroups') as s
left join aws_vpc_security_group as sg on sg.group_id = s
where
e.arn = $1
and e.network_configuration is not null
and e.account_id = split_part($1, ':', 5)
and e.region = split_part($1, ':', 4);