Working with Amazon EventBridge events and notifications in AWS Database Migration Service - AWS Database Migration Service

Working with Amazon EventBridge events and notifications in AWS Database Migration Service

You can use Amazon EventBridge to provide notification of when an AWS DMS event occurs, for example the creation or deletion of a replication instance. EventBridge receives events and routes notification of an event as defined by event rules. You can work with notifications in any form supported by Amazon EventBridge for an AWS Region. For more information about using Amazon EventBridge, see What is Amazon EventBridge? in the Amazon EventBridge User Guide.

Note

Working with Amazon EventBridge events is supported in AWS DMS version 3.4.5 and higher.

EventBridge receives an event, an indicator of a change in AWS DMS environment, and applies a rule to route the event to a notification mechanism. Rules match events to notification mechanisms based on the structure of the event, called an event pattern.

AWS DMS groups events into categories that you can apply an event rule to, so you can be notified when an event in that category occurs. For example, suppose that you apply an EventBridge event rule to the Creation category for a given replication instance. You're then notified whenever a creation-related event occurs that affects your replication instance. If you apply a rule to a Configuration Change category for a replication instance, you're notified when the replication instance's configuration is changed. For a list of the event categories provided by AWS DMS, see the AWS DMS event categories and event messages, following.

Note

To allow publishing from events.amazonaws.com, make sure to update your Amazon SNS topics' access policies. For more information, see Using resource-based policies for Amazon EventBridge in the Amazon EventBridge User Guide.

For more information about moving event subscriptions to Amazon EventBridge, see migrate active event subscriptions from DMS to Amazon EventBridge.

For more information on using text messages with Amazon SNS, see Sending and receiving SMS notifications using Amazon SNS.

Using Amazon EventBridge event rules for AWS DMS

Amazon EventBridge sends event notifications to the addresses that you provide when you create an EventBridge event rule. You might want to create several different rules. For example, you might create one rule receiving all event notifications and another rule that includes only critical events for your production DMS resources. You can also turn on or turn off event notifications in EventBridge.

To create Amazon EventBridge rules that react to AWS DMS events
  • Perform the steps described in Creating Amazon EventBridge rules that react to events in the Amazon EventBridge User Guide, and create a rule for AWS DMS events:

    1. Specify a notification action to take when EventBridge receives an event that matches the event pattern in the rule. When an event matches, EventBridge sends the event and invokes the action defined in the rule.

    2. For Service provider, choose AWS.

    3. For Service name, choose Database Migration Service (DMS).

You can then begin to receive event notifications.

The following JSON example shows an EventBridge events model for an AWS DMS service.

{ "version":"0", "id":"11a11b11-222b-333a-44d4-01234a5b67890", "detail-type":"DMS Replication Task State Change", "source":"aws.dms", "account":"0123456789012", "time":"1970-01-01T00:00:00Z", "region":"us-east-1", "resources":[ "arn:aws:dms:us-east-1:012345678901:task:AAAABBBB0CCCCDDDDEEEEE1FFFF2GGG3FFFFFF3" ], "detail":{ "type":"REPLICATION_TASK", "category":"StateChange", "eventType":"REPLICATION_TASK_STARTED", "eventId":"DMS-EVENT-0069", "resourceLink":"https://console.aws.amazon.com/dms/v2/home?region=us-east-1#taskDetails/taskName", "detailMessage":"Replication task started, with flag = fresh start" } }

For the list of categories and events that you can be notified of, see the following section.

AWS DMS event categories and event messages

AWS DMS generates a significant number of events in categories that you can identify. Each category applies to a replication instance or replication task source types.

ReplicationInstance event messages

The following table shows the possible categories and events for the ReplicationInstance source type.

Category

Event ID

Description

Creation DMS-EVENT-0067

A replication instance is being created.

Deletion DMS-EVENT-0066

The replication instance is being deleted.

Configuration Change DMS-EVENT-0012

The replication instance class for this replication instance is being changed.

Configuration Change DMS-EVENT-0018

The storage for the replication instance is being increased.

Configuration Change DMS-EVENT-0024

The replication instance is transitioning to a Multi-AZ configuration.

Configuration Change DMS-EVENT-0030

The replication instance is transitioning to a Single-AZ configuration.

Maintenance DMS-EVENT-0026 Offline maintenance of the replication instance is taking place. The replication instance is currently unavailable.
Creation DMS-EVENT-0005

A replication instance has been created.

Deletion DMS-EVENT-0003

The replication instance has been deleted.

Configuration Change DMS-EVENT-0014

The replication instance class for this replication instance has changed.

Configuration Change DMS-EVENT-0017

The storage for the replication instance has been increased.

Configuration Change DMS-EVENT-0025

The replication instance has finished transitioning to a Multi-AZ configuration.

Configuration Change DMS-EVENT-0029

The replication instance has finished transitioning to a Single-AZ configuration.

Maintenance DMS-EVENT-0047 Management software on the replication instance has been updated.
Maintenance DMS-EVENT-0027 Offline maintenance of the replication instance is complete. The replication instance is now available.
Maintenance DMS-EVENT-0068 Replication instance is in a state that cannot be upgraded.
Failover DMS-EVENT-0034 If you request Failover too frequently, this event occurs instead of regular failover events.
Failure DMS-EVENT-0031 Replication instance put into %s state.
Failure DMS-EVENT-0036 The replication instance has failed due to an incompatible network.
Failure DMS-EVENT-0037 When service is unable to access the KMS key used to encrypt the data volume.
Failure Replication instance put into incompatible-parameters
Failover Timed out waiting for a state safe to initiate user requested failover
Failover DMS-EVENT-0013 Failover started for a Multi-AZ replication instance.
Failover DMS-EVENT-0049 Failover has been completed for a Multi-AZ replication instance.
Failover DMS-EVENT-0050 Multi-AZ activation has started.
Failover DMS-EVENT-0051 Multi-AZ activation completed.
StateChange General and slow query logs have been automatically rotated as %s
StateChange AWS DMS is unable to access the KMS encryption key for application instance %s. This is likely due to the key being disabled or AWS DMS being unable to access it. If this continues the application will be placed into an inaccessible state. Please refer to the troubleshooting section in the AWS DMS documentation for further details.
StateChange AWS DMS can now successfully access the KMS encryption key for application instance %s.
StateChange Amazon DMS has been unable to access the KMS encryption key for application instance %s. This application will be placed into an inaccessible state. Please refer to the troubleshooting section in the Amazon DMS documentation for further details.
StateChange App Restart on HM as part of Replication Instance creation
StateChange App Shutdown on HM as part of Replication Instance deletion
Failover DMS-EVENT-0015 Multi-AZ failover to standby complete.
LowStorage DMS-EVENT-0007 Free storage for the replication instance is low.
LowStorage Allocated inodes have been exhausted - scale storage to resolve

ReplicationTask event messages

The following table shows the possible categories and events for the ReplicationTask source type.

Category

Event ID

Description

Failure DMS-EVENT-0078 A replication task has failed.
Failure DMS-EVENT-0082 A call to clean task data has failed.
State Change DMS-EVENT-0081 Reload of table details has been requested.
State Change

Replication task has been copied.

State Change

Replication task copy has failed.

State Change

Replication task has been moved.

State Change

Replication task move has failed.

State Change

Creation of target task failed.

State Change

Replication task assessment run has started.

State Change

Replication task assessment run has finished successfully.

State Change

Replication task assessment run has finished with failure.

StateChange Replication task assessment run has finished with warning.
StateChange Replication task assessment run has finished with error.
StateChange Replication task assessment run %s has been cancelled.
StateChange Replication task assessment run %s has been deleted.
StateChange Replication task assessment run has failed to provision resources.
StateChange Replication task has failed.
Creation The replication task has been created.
ConfigurationChange A replication task has been modified.
Failure A replication task has failed.
StateChange DMS-EVENT-0091 Reading paused, swap files limit reached.
StateChange DMS-EVENT-0092 Reading paused, disk usage limit reached.
StateChange DMS-EVENT-0093 Reading paused, disk usage limit reached.
StateChange DMS-EVENT-0093 Reading resumed.
StateChange DMS-EVENT-0069 The replication task has started with taskType: %s, startType: %s
StateChange DMS-EVENT-0079 Replication task stopped
Deletion DMS-EVENT-0073 The replication task has been deleted.

Replication event messages

The following table shows the possible categories and events for the Replication source type.

Category

Description

State Change

DMS replication scaling up event.

State Change

DMS replication scaling down event.

State Change

DMS replication scaling event completed.

State Change

DMS replication has been created.

State Change DMS replication is initializing.
State Change DMS replication is preparing the resources for metadata collection.
State Change The connections tied to DMS replication is being tested.
State Change DMS replication is fetching metadata
State Change DMS replication is calculating capacity
State Change DMS replication is provisioning its capacity
State Change DMS replication has been provisioned.
State Change DMS replication has started
State Change DMS replication is running.
State Change DMS replication is being stopped.
State Change DMS replication has stopped
State Change DMS replication is being modified.
State Change DMS replication is being deleted.
State Change DMS replication is deprovisioning its capacity
State Change DMS replication has been deprovisioned.
Failure

DMS replication has failed.