AWS::RDS::DBSubnetGroup
The AWS::RDS::DBSubnetGroup type creates an RDS database subnet group. Subnet groups must contain at least two subnets in two different Availability Zones in the same region.
Topics
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" : [Resource Tag, ...] } }
YAML
Type: "AWS::RDS::DBSubnetGroup" Properties: DBSubnetGroupDescription:StringDBSubnetGroupName:StringSubnetIds: -StringTags: -Resource 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.
Required: No
Type: String
Update requires: Replacement
SubnetIds-
The EC2 Subnet IDs for the DB Subnet Group.
Required: Yes
Type: List of String values
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
{ "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: Type: "AWS::RDS::DBSubnetGroup" Properties: DBSubnetGroupDescription: "description" SubnetIds: - "subnet-7b5b4112" - "subnet-7b5b4115" Tags: - Key: "String" Value: "String"
See Also
-
CreateDBSubnetGroup in the Amazon Relational Database Service API Reference
-
ModifyDBSubnetGroup in the Amazon Relational Database Service API Reference
