AWS CloudFormation
User Guide (Version )

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.


The AWS::DocDB::DBSubnetGroup Amazon DocumentDB (with MongoDB compatibility) resource describes a DBSubnetGroup. subnet groups must contain at least one subnet in at least two Availability Zones in the AWS Region. For more information, see DBSubnetGroup in the Amazon DocumentDB Developer Guide.


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


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


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



The description for the subnet group.

Required: Yes

Type: String

Update requires: No interruption


The name for the 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.

Example: mySubnetgroup

Required: No

Type: String

Update requires: Replacement


The Amazon EC2 subnet IDs for the subnet group.

Required: Yes

Type: List of String

Update requires: No interruption


The tags to be assigned to the subnet group.

Required: No

Type: List of Tag

Update requires: No interruption

Return Values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the DBSubnetGroup's name, such as default.

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



{ "AWSTemplateFormatVersion" : "2010-09-09", "Resources" : { "myDBSubnetGroup" : { "Type" : "AWS::DocDB::DBSubnetGroup", "Properties" : { "DBSubnetGroupDescription" : "description", "SubnetIds" : [ "subnet-7b5b4112", "subnet-7b5b4115" ], "Tags" : [ {"Key" : "String", "Value" : "String"} ] } } } }


AWSTemplateFormatVersion: "2010-09-09" Resources: myDBSubnetGroup: Type: "AWS::DocDB::DBSubnetGroup" Properties: DBSubnetGroupDescription: "description" SubnetIds: - "subnet-7b5b4112" - "subnet-7b5b4115" Tags: - Key: "String" Value: "String"

See Also