AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::RDS::DBSubnetGroup

CfnDBSubnetGroup

The `AWS::RDS::DBSubnetGroup` resource creates a database subnet group. Subnet groups must contain at least two subnets in two different Availability Zones in the same region. For more information, see [Working with DB subnet groups](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html#USER_VPC.Subnets) in the *Amazon RDS User Guide* .

Import

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

Or use the module namespace:

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

Properties

Configuration passed to the constructor as CfnDBSubnetGroupProps.

dbSubnetGroupDescriptionRequired
string

The description for the DB subnet group.

subnetIdsRequired
string | ISubnetRef[]

The EC2 Subnet IDs for the DB subnet group.

dbSubnetGroupNameOptional
string

The name for the DB subnet group. This value is stored as a lowercase string. Constraints: - Must contain no more than 255 letters, numbers, periods, underscores, spaces, or hyphens. - Must not be default. - First character must be a letter. Example: `mydbsubnetgroup`

tagsOptional
CfnTag[]

Tags to assign to the DB subnet group.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon RDS Cheat Sheet

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

Download Free Infographic