turbot/aws_insights

Query: rds_db_subnet_groups_for_rds_db_instance

Usage

powerpipe query aws_insights.query.rds_db_subnet_groups_for_rds_db_instance

SQL

with rds_db_instance as (
select
arn,
db_subnet_group_name,
region,
account_id
from
aws_rds_db_instance
where
account_id = split_part($1, ':', 5)
and region = split_part($1, ':', 4)
and arn = $1
order by
arn,
db_subnet_group_name,
region,
account_id
), rds_db_subnet_group as (
select
arn,
name,
region,
account_id
from
aws_rds_db_subnet_group
where
account_id = split_part($1, ':', 5)
and region = split_part($1, ':', 4)
order by
arn,
name,
region,
account_id
)
select
g.arn as db_subnet_group_arn
from
rds_db_instance as i,
rds_db_subnet_group g
where
i.db_subnet_group_name = g.name;