

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::MemoryDB::SubnetGroup
<a name="aws-resource-memorydb-subnetgroup"></a>

Specifies a subnet group. A subnet group is a collection of subnets (typically private) that you can designate for your clusters running in an Amazon Virtual Private Cloud (VPC) environment. When you create a cluster in an Amazon VPC, you must specify a subnet group. MemoryDB uses that subnet group to choose a subnet and IP addresses within that subnet to associate with your nodes. For more information, see [Subnets and subnet groups](https://docs.aws.amazon.com/memorydb/latest/devguide/subnetgroups.html).

## Syntax
<a name="aws-resource-memorydb-subnetgroup-syntax"></a>

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

### JSON
<a name="aws-resource-memorydb-subnetgroup-syntax.json"></a>

```
{
  "Type" : "AWS::MemoryDB::SubnetGroup",
  "Properties" : {
      "[Description](#cfn-memorydb-subnetgroup-description)" : String,
      "[SubnetGroupName](#cfn-memorydb-subnetgroup-subnetgroupname)" : String,
      "[SubnetIds](#cfn-memorydb-subnetgroup-subnetids)" : [ String, ... ],
      "[Tags](#cfn-memorydb-subnetgroup-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-memorydb-subnetgroup-syntax.yaml"></a>

```
Type: AWS::MemoryDB::SubnetGroup
Properties:
  [Description](#cfn-memorydb-subnetgroup-description): String
  [SubnetGroupName](#cfn-memorydb-subnetgroup-subnetgroupname): String
  [SubnetIds](#cfn-memorydb-subnetgroup-subnetids): 
    - String
  [Tags](#cfn-memorydb-subnetgroup-tags): 
    - Tag
```

## Properties
<a name="aws-resource-memorydb-subnetgroup-properties"></a>

`Description`  <a name="cfn-memorydb-subnetgroup-description"></a>
A description of the subnet group.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SubnetGroupName`  <a name="cfn-memorydb-subnetgroup-subnetgroupname"></a>
The name of the subnet group to be used for the cluster.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[a-z][a-z0-9\-]*`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`SubnetIds`  <a name="cfn-memorydb-subnetgroup-subnetids"></a>
A list of Amazon VPC subnet IDs for the subnet group.  
*Required*: Yes  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-memorydb-subnetgroup-tags"></a>
An array of key-value pairs to apply to this resource.  
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).  
*Required*: No  
*Type*: Array of [Tag](aws-properties-memorydb-subnetgroup-tag.md)  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-memorydb-subnetgroup-return-values"></a>

### Fn::GetAtt
<a name="aws-resource-memorydb-subnetgroup-return-values-fn--getatt"></a>

#### 
<a name="aws-resource-memorydb-subnetgroup-return-values-fn--getatt-fn--getatt"></a>

`ARN`  <a name="ARN-fn::getatt"></a>
When you pass the logical ID of this resource to the intrinsic `Ref` function, Ref returns the ARN of the subnet group, such as `arn:aws:memorydb:us-east-1:123456789012:subnetgroup/my-subnet-group`

`SupportedNetworkTypes`  <a name="SupportedNetworkTypes-fn::getatt"></a>
The network types supported by this subnet. Returns an array of strings that can include 'ipv4', 'ipv6', or both, indicating whether the subnet supports IPv4 only, IPv6 only, or dual-stack deployments.

# AWS::MemoryDB::SubnetGroup Tag
<a name="aws-properties-memorydb-subnetgroup-tag"></a>

A tag that can be added to an MemoryDB resource. Tags are composed of a Key/Value pair. You can use tags to categorize and track all your MemoryDB resources. When you add or remove tags on clusters, those actions will be replicated to all nodes in the cluster. A tag with a null Value is permitted. For more information, see [Tagging your MemoryDB resources](https://docs.aws.amazon.com/MemoryDB/latest/devguide/tagging-resources.html)

## Syntax
<a name="aws-properties-memorydb-subnetgroup-tag-syntax"></a>

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

### JSON
<a name="aws-properties-memorydb-subnetgroup-tag-syntax.json"></a>

```
{
  "[Key](#cfn-memorydb-subnetgroup-tag-key)" : String,
  "[Value](#cfn-memorydb-subnetgroup-tag-value)" : String
}
```

### YAML
<a name="aws-properties-memorydb-subnetgroup-tag-syntax.yaml"></a>

```
  [Key](#cfn-memorydb-subnetgroup-tag-key): String
  [Value](#cfn-memorydb-subnetgroup-tag-value): String
```

## Properties
<a name="aws-properties-memorydb-subnetgroup-tag-properties"></a>

`Key`  <a name="cfn-memorydb-subnetgroup-tag-key"></a>
The key for the tag. May not be null.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^(?!aws:)(?!memorydb:)[a-zA-Z0-9 _\.\/=+:\-@]{1,128}$`  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-memorydb-subnetgroup-tag-value"></a>
The tag's value. May be null.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^(?!aws:)(?!memorydb:)[a-zA-Z0-9 _\.\/=+:\-@]{1,256}$`  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)