Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

AWS::RDS::DBSubnetGroup

Focus mode
AWS::RDS::DBSubnetGroup - AWS CloudFormation
Filter View

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.

Syntax

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

JSON

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

YAML

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

Properties

DBSubnetGroupDescription

The description for the DB subnet group.

Required: Yes

Type: String

Update requires: No interruption

DBSubnetGroupName

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

Required: No

Type: String

Update requires: Replacement

SubnetIds

The EC2 Subnet IDs for the DB subnet group.

Required: Yes

Type: Array of String

Update requires: No interruption

Tags

Tags to assign to the DB subnet group.

Required: No

Type: Array of Tag

Maximum: 50

Update requires: No interruption

Return values

Ref

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.

Examples

Create a DB subnet group

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

JSON

{ "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" } ] } } } }

YAML

--- 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

On this page

Next topic:

Tag

Previous topic:

Tag
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.