Working with events and notifications in AWS Database Migration Service
AWS Database Migration Service (AWS DMS) uses Amazon Simple Notification Service (Amazon SNS) to provide notifications when an AWS DMS event occurs, for example the creation or deletion of a replication instance. You can work with these notifications in any form supported by Amazon SNS for an AWS Region, such as an email message, a text message, or a call to an HTTP endpoint.
AWS DMS groups events into categories that you can subscribe to, so you can be notified when an event in that category occurs. For example, if you subscribe to the Creation category for a given replication instance, you are notified whenever a creation-related event occurs that affects your replication instance. If you subscribe to a Configuration Change category for a replication instance, you are notified when the replication instance's configuration is changed. You also receive notification when an event notification subscription changes. For a list of the event categories provided by AWS DMS, see AWS DMS event categories and event messages, following.
AWS DMS sends event notifications to the addresses you provide when you create an
event
subscription. You might want to create several different subscriptions, such as one
subscription receiving all event notifications and another subscription that includes
only
critical events for your production DMS resources. You can easily turn off notification
without deleting a subscription by deselecting the Enabled option in
the AWS DMS console, or by setting the Enabled
parameter to
false using the AWS DMS API.
AWS DMS event notifications using SMS text messages are currently available for AWS DMS resources in all AWS Regions where Amazon SNS is supported. For a list of AWS Regions and countries where Amazon SNS supports SMS messaging, see Supported Regions and countries.
For more information on using text messages with SNS, see Sending and receiving SMS notifications using Amazon SNS.
AWS DMS uses a subscription identifier to identify each subscription. You can have
multiple AWS DMS event subscriptions published to the same Amazon SNS topic. When
you use
event notification, Amazon SNS fees apply; for more information on Amazon SNS billing,
see Amazon SNS pricing
To subscribe to AWS DMS events, you use the following process:
-
Create an Amazon SNS topic. In the topic, you specify what type of notification you want to receive and to what address or number the notification will go to.
-
Create an AWS DMS event notification subscription by using the AWS Management Console, AWS CLI, or AWS DMS API.
-
AWS DMS sends an approval email or SMS message to the addresses you submitted with your subscription. To confirm your subscription, click the link in the approval email or SMS message.
-
When you have confirmed the subscription, the status of your subscription is updated in the AWS DMS console's Event subscriptions section.
-
You then begin to receive event notifications.
For the list of categories and events that you can be notified of, see the following section. For more details about subscribing to and working with AWS DMS event subscriptions, see Subscribing to AWS DMS event notification.
AWS DMS event categories and event messages
AWS DMS generates a significant number of events in categories that you can subscribe to using the AWS DMS console or the AWS DMS API. Each category applies to a source type; currently AWS DMS supports the replication instance and replication task source types.
The following table shows the possible categories and events for the replication instance source type.
The following table shows the possible categories and events for the replication task source type.
The following example shows an AWS DMS event subscription with the State Change category.
Resources: DMSEvent: Type: AWS::DMS::EventSubscription Properties: Enabled: true EventCategories: State Change SnsTopicArn: arn:aws:sns:us-east-1:123456789:testSNS SourceIds: [] SourceType: replication-task
Subscribing to AWS DMS event notification
You can create an AWS DMS event notification subscription so you can be notified when an AWS DMS event occurs. The simplest way to create a subscription is with the AWS DMS console. In a notification subscription, you choose how and where to send notifications. You specify the type of source you want to be notified of; currently AWS DMS supports the replication instance and replication task source types. And, depending on the source type you select, you choose the event categories and identify the source you want to receive event notifications for.
Using the AWS Management Console
To subscribe to AWS DMS event notification by using the console
-
Sign in to the AWS Management Console and open the AWS DMS console at https://console.aws.amazon.com/dms/v2/
. If you're signed in as an AWS Identity and Access Management (IAM) user, make sure that you have the appropriate permissions to access AWS DMS.
-
In the navigation pane, choose Event subscriptions.
-
On the Event subscriptions page, choose Create event subscription.
-
On the Create event subscription page, do the following:
-
Under Details, for Name, enter a name for the event notification subscription.
-
Choose Enabled to enable the subscription. If you want to create the subscription but not have notifications sent yet, don't choose Enabled.
-
Under Target, choose either Existing topics, Create new email topic or Create new SMS topic to send notifications. Make sure that you either have an existing Amazon SNS topic to send notices to or create the topic. If you create a topic, you can enter an email address where notifications will be sent.
-
Under Event source, for Source type, choose a source type. The only options are replication-instance and replication-task.
-
Depending on the source type you selected, choose the event categories and sources you want to receive event notifications for.
-
Select Create event subscription.
-
The AWS DMS console indicates that the subscription is being created.
Using AWS DMS API and CLI
If you choose to create event notification subscriptions using AWS DMS API, you must create an Amazon SNS topic and subscribe to that topic with the Amazon SNS console or API. In this case, you also need to note the topic's Amazon Resource Name (ARN), because this ARN is used when submitting CLI commands or API actions. For information on creating an Amazon SNS topic and subscribing to it, see Getting started with Amazon SNS.
In a notification subscription created using the AWS DMS API or CLI, you can specify the type of source you want to be notified of, and the AWS DMS source that triggers the event. You define the type of source by specifying a source type value. You define the source generating the event by specifying a source identifier value.
The following create-event-subscription
example shows the syntax to
create event notification subscriptions using the AWS CLI.
aws dms create-event-subscription \ --subscription-name string \ --sns-topic-arn string \ [--source-type string] \ [--event-categories string] \ [--source-ids string] \ [--enabled | --no-enabled] \ [--tags string] \ [--cli-input-json string] \ [--generate-cli-skeleton string]
To subscribe to AWS DMS event notification using the AWS DMS API, call the CreateEventSubscription
operation. The
following provides an example request syntax for the
CreateEventSubscription
API operation.
{ "Enabled": boolean, "EventCategories": [ "string" ], "SnsTopicArn": "string", "SourceIds": [ "string" ], "SourceType": "string", "SubscriptionName": "string", "Tags": [ { "Key": "string", "Value": "string" } ] }