AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

SubnetGroup

Class for creating a RDS DB subnet group.

Import

import { SubnetGroup } from 'aws-cdk-lib/aws-rds';

Or use the module namespace:

import * as rds from 'aws-cdk-lib/aws-rds';
// rds.SubnetGroup

Properties

Configuration passed to the constructor as SubnetGroupProps.

descriptionRequired
string

Description of the subnet group.

vpcRequired
IVpc

The VPC to place the subnet group in.

removalPolicyOptional
RemovalPolicy

The removal policy to apply when the subnet group are removed from the stack or replaced during an update.

Default: RemovalPolicy.DESTROY

subnetGroupNameOptional
string

The name of the subnet group.

Default: - a name is generated

vpcSubnetsOptional
SubnetSelection

Which subnets within the VPC to associate with this group.

Default: - private subnets

Get the Amazon RDS Cheat Sheet

Everything you need to know about Amazon RDS on one page. HD quality, print-friendly.

Download Free Infographic