Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::RDS::DBSubnetGroup

The AWS::RDS::DBSubnetGroup type creates an RDS database subnet group. Subnet groups must contain at least two subnet in two different Availability Zones in the same region.

Syntax

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

JSON

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

YAML

Copy
Type: "AWS::RDS::DBSubnetGroup" Properties: DBSubnetGroupDescription: String SubnetIds: - String Tags: - Resource Tag

Properties

DBSubnetGroupDescription

The description for the DB Subnet Group.

Required: Yes

Type: String

Update requires: No interruption

SubnetIds

The EC2 Subnet IDs for the DB Subnet Group.

Required: Yes

Type: List of strings

Update requires: No interruption

Tags

The tags that you want to attach to the RDS database subnet group.

Required: No

Type: A list of resource tags in key-value format.

Update requires: No interruption

Return Value

Ref

When you pass the logical ID of an AWS::RDS::DBSubnetGroup resource to the intrinsic Ref function, the function returns the name of the DB subnet group, such as mystack-mydbsubnetgroup-0a12bc456789de0fg.

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

Example

JSON

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

YAML

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

See Also