AWS::RDS::DBSubnetGroup - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


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 in the Amazon RDS User Guide.


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::RDS::DBSubnetGroup", "Properties" : { "DBSubnetGroupDescription" : String, "DBSubnetGroupName" : String, "SubnetIds" : [ String, ... ], "Tags" : [ Tag, ... ] } }


Type: AWS::RDS::DBSubnetGroup Properties: DBSubnetGroupDescription: String DBSubnetGroupName: String SubnetIds: - String Tags: - Tag



The description for the DB subnet group.

Required: Yes

Type: String

Update requires: No interruption


The name for the DB subnet group. This value is stored as a lowercase string.

Constraints: Must contain no more than 255 lowercase alphanumeric characters or hyphens. Must not be "Default".

Example: mysubnetgroup

Required: No

Type: String

Update requires: Replacement


The EC2 Subnet IDs for the DB subnet group.

Required: Yes

Type: Array of String

Update requires: No interruption


An optional array of key-value pairs to apply to this DB subnet group.

Required: No

Type: Array of Tag

Maximum: 50

Update requires: No interruption

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the name of the DB subnet group.

For more information about using the Ref function, see Ref.


Create a DB subnet group

The following example creates a DB subnet group with two subnet IDs and a set of tags.


{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "myDBSubnetGroup": { "Type": "AWS::RDS::DBSubnetGroup", "Properties": { "DBSubnetGroupDescription": "Description of subnet group", "SubnetIds": [ "subnet-7b5b4112", "subnet-7b5b4115" ], "Tags": [ { "Key": "mykey", "Value": "myvalue" } ] } } } }


--- AWSTemplateFormatVersion: "2010-09-09" Resources: myDBSubnetGroup: Type: AWS::RDS::DBSubnetGroup Properties: DBSubnetGroupDescription: Description of subnet group SubnetIds: - subnet-7b5b4112 - subnet-7b5b4115 Tags: - Key: mykey Value: myvalue