turbot/aws_insights

Query: vpc_subnets_for_efs_file_system

Usage

powerpipe query aws_insights.query.vpc_subnets_for_efs_file_system

SQL

with relevant_mount_targets as (
select
m.subnet_id
from
aws_efs_mount_target m
join
aws_efs_file_system f on f.file_system_id = m.file_system_id
where
f.arn = $1
and f.account_id = split_part($1, ':', 5)
and f.region = split_part($1, ':', 4)
)
select
s.subnet_id as subnet_id
from
aws_vpc_subnet s
join
relevant_mount_targets rmt on rmt.subnet_id = s.subnet_id;