

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::DMS::EventSubscription
<a name="aws-resource-dms-eventsubscription"></a>

Use the `AWS::DMS::EventSubscription` resource to get notifications for AWS Database Migration Service events through the Amazon Simple Notification Service. For more information, see [Working with events and notifications in AWS Database Migration Service](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html) in the *AWS Database Migration Service User Guide*.

## Syntax
<a name="aws-resource-dms-eventsubscription-syntax"></a>

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

### JSON
<a name="aws-resource-dms-eventsubscription-syntax.json"></a>

```
{
  "Type" : "AWS::DMS::EventSubscription",
  "Properties" : {
      "[Enabled](#cfn-dms-eventsubscription-enabled)" : Boolean,
      "[EventCategories](#cfn-dms-eventsubscription-eventcategories)" : [ String, ... ],
      "[SnsTopicArn](#cfn-dms-eventsubscription-snstopicarn)" : String,
      "[SourceIds](#cfn-dms-eventsubscription-sourceids)" : [ String, ... ],
      "[SourceType](#cfn-dms-eventsubscription-sourcetype)" : String,
      "[SubscriptionName](#cfn-dms-eventsubscription-subscriptionname)" : String,
      "[Tags](#cfn-dms-eventsubscription-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-dms-eventsubscription-syntax.yaml"></a>

```
Type: AWS::DMS::EventSubscription
Properties:
  [Enabled](#cfn-dms-eventsubscription-enabled): Boolean
  [EventCategories](#cfn-dms-eventsubscription-eventcategories): 
    - String
  [SnsTopicArn](#cfn-dms-eventsubscription-snstopicarn): String
  [SourceIds](#cfn-dms-eventsubscription-sourceids): 
    - String
  [SourceType](#cfn-dms-eventsubscription-sourcetype): String
  [SubscriptionName](#cfn-dms-eventsubscription-subscriptionname): String
  [Tags](#cfn-dms-eventsubscription-tags): 
    - Tag
```

## Properties
<a name="aws-resource-dms-eventsubscription-properties"></a>

`Enabled`  <a name="cfn-dms-eventsubscription-enabled"></a>
Indicates whether to activate the subscription. If you don't specify this property, CloudFormation activates the subscription.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EventCategories`  <a name="cfn-dms-eventsubscription-eventcategories"></a>
A list of event categories for a source type that you want to subscribe to. If you don't specify this property, you are notified about all event categories. For more information, see [ Working with Events and Notifications](https://docs.aws.amazon.com//dms/latest/userguide/CHAP_Events.html) in the *AWS DMS User Guide*.  
*Required*: No  
*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)

`SnsTopicArn`  <a name="cfn-dms-eventsubscription-snstopicarn"></a>
 The Amazon Resource Name (ARN) of the Amazon SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SourceIds`  <a name="cfn-dms-eventsubscription-sourceids"></a>
A list of identifiers for which AWS DMS provides notification events.  
If you don't specify a value, notifications are provided for all sources.  
If you specify multiple values, they must be of the same type. For example, if you specify a database instance ID, then all of the other values must be database instance IDs.  
*Required*: No  
*Type*: Array of String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`SourceType`  <a name="cfn-dms-eventsubscription-sourcetype"></a>
 The type of AWS DMS resource that generates the events. For example, if you want to be notified of events generated by a replication instance, you set this parameter to `replication-instance`. If this value isn't specified, all events are returned.  
*Valid values*: `replication-instance` \$1 `replication-task`  
*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)

`SubscriptionName`  <a name="cfn-dms-eventsubscription-subscriptionname"></a>
The name of the AWS DMS event notification subscription. This name must be less than 255 characters.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Tags`  <a name="cfn-dms-eventsubscription-tags"></a>
One or more tags to be assigned to the event subscription.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-dms-eventsubscription-tag.md)  
*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-dms-eventsubscription-return-values"></a>

### Ref
<a name="aws-resource-dms-eventsubscription-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the resource name, for example:

 `{ "Ref": "myEventSubscription" }` 

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

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

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

## Examples
<a name="aws-resource-dms-eventsubscription--examples"></a>



### 
<a name="aws-resource-dms-eventsubscription--examples--"></a>

The following snippet creates an event subscription for an existing replication instance `rep-instance-1`, which is declared elsewhere in the same template.

#### JSON
<a name="aws-resource-dms-eventsubscription--examples----json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "myEventSubscription": {
            "Type": "AWS::DMS::EventSubscription",
            "Properties": {
                "EventCategories": [
                    "configuration change",
                    "failure",
                    "deletion"
                ],
                "SnsTopicArn": "arn:aws:sns:us-west-2:123456789012:example-topic",
                "SourceIds": [
                    "rep-instance-1"
                ],
                "SourceType": "replication-instance",
                "Enabled": false
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-dms-eventsubscription--examples----yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources: 
  myEventSubscription:
    Type: AWS::DMS::EventSubscription
    Properties: 
      Enabled: false
      EventCategories: 
        - "configuration change"
        - failure
        - deletion
      SnsTopicArn: "arn:aws:sns:us-west-2:123456789012:example-topic"
      SourceIds: 
        - rep-instance-1
      SourceType: replication-instance
```

## See also
<a name="aws-resource-dms-eventsubscription--seealso"></a>
+ [ CreateEventSubscription](https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateEventSubscription.html) in the *AWS Database Migration Service API Reference*
+  [Managing AWS resources as a single unit with AWS CloudFormation stacks](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacks.html) 



# AWS::DMS::EventSubscription Tag
<a name="aws-properties-dms-eventsubscription-tag"></a>

A user-defined key-value pair that describes metadata added to an AWS DMS resource and that is used by operations such as the following:
+  `AddTagsToResource` 
+  `ListTagsForResource` 
+  `RemoveTagsFromResource` 

## Syntax
<a name="aws-properties-dms-eventsubscription-tag-syntax"></a>

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

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

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

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

```
  [Key](#cfn-dms-eventsubscription-tag-key): String
  [Value](#cfn-dms-eventsubscription-tag-value): String
```

## Properties
<a name="aws-properties-dms-eventsubscription-tag-properties"></a>

`Key`  <a name="cfn-dms-eventsubscription-tag-key"></a>
A key is the required name of the tag. The string value can be 1-128 Unicode characters in length and can't be prefixed with "aws:" or "dms:". The string can only contain only the set of Unicode letters, digits, white-space, '\$1', '.', '/', '=', '\$1', '-' (Java regular expressions: "^([\$1\$1p\$1L\$1\$1\$1p\$1Z\$1\$1\$1p\$1N\$1\$1.:/=\$1\$1\$1-]\$1)\$1").  
*Required*: Yes  
*Type*: String  
*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-dms-eventsubscription-tag-value"></a>
A value is the optional value of the tag. The string value can be 1-256 Unicode characters in length and can't be prefixed with "aws:" or "dms:". The string can only contain only the set of Unicode letters, digits, white-space, '\$1', '.', '/', '=', '\$1', '-' (Java regular expressions: "^([\$1\$1p\$1L\$1\$1\$1p\$1Z\$1\$1\$1p\$1N\$1\$1.:/=\$1\$1\$1-]\$1)\$1").  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)