turbot/aws_insights

Query: vpc_subnets_for_ecs_service

Usage

powerpipe query aws_insights.query.vpc_subnets_for_ecs_service

SQL

select
sb.subnet_id as subnet_id
from
aws_ecs_service as e,
jsonb_array_elements(e.network_configuration -> 'AwsvpcConfiguration' -> 'Subnets') as s
left join aws_vpc_subnet as sb on sb.subnet_id = trim((s::text ), '""')
where
e.network_configuration is not null
and e.arn = $1
and e.account_id = split_part($1, ':', 5)
and e.region = split_part($1, ':', 4);