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.

AWS::RDS::DBSubnetGroup

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.

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 alphanumeric characters or hyphens. Must not be "Default".

Example: mySubnetgroup

Required: No

Type: String

Update requires: Replacement

SubnetIds

The EC2 Subnet IDs for the DB Subnet Group.

Required: Yes

Type: List of String

Update requires: No interruption

Tags

Tags to assign to the DB subnet group.

Required: No

Type: List of Tag

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

JSON

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

YAML

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