Skip to main content

event_subscriptions

Creates, updates, deletes, gets or lists an event_subscriptions resource.

Overview

Nameevent_subscriptions
TypeResource
Idaws.dms.event_subscriptions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
cust_subscription_idstringThe DMS event notification subscription Id.
customer_aws_idstringThe Amazon Web Services customer account associated with the DMS event notification subscription.
enabledbooleanBoolean value that indicates if the event subscription is enabled.
event_categories_listarrayA lists of event categories.
sns_topic_arnstringThe topic ARN of the DMS event notification subscription.
source_ids_listarrayA list of source Ids for the event subscription.
source_typestringThe type of DMS resource that generates events. Valid values: replication-instance | replication-server | security-group | replication-task
statusstringThe status of the DMS event notification subscription. Constraints: Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist The status "no-permission" indicates that DMS no longer has permission to post to the SNS topic. The status "topic-not-exist" indicates that the topic was deleted after the subscription was created.
subscription_creation_timestringThe time the DMS event notification subscription was created.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_event_subscriptionsselectregionLists all the event subscriptions for a customer account. The description of a subscription includes SubscriptionName, SNSTopicARN, CustomerID, SourceType, SourceID, CreationTime, and Status. If you specify SubscriptionName, this action lists the description for that subscription.
create_event_subscriptioninsertregion, SubscriptionName, SnsTopicArnCreates an DMS event notification subscription. You can specify the type of source (SourceType) you want to be notified of, provide a list of DMS source IDs (SourceIds) that triggers the events, and provide a list of event categories (EventCategories) for events you want to be notified of. If you specify both the SourceType and SourceIds, such as SourceType = replication-instance and SourceIdentifier = my-replinstance, you will be notified of all the replication instance events for the specified source. If you specify a SourceType but don't specify a SourceIdentifier, you receive notice of the events for that source type for all your DMS sources. If you don't specify either SourceType nor SourceIdentifier, you will be notified of events generated from all DMS sources belonging to your customer account. For more information about DMS events, see Working with Events and Notifications in the Database Migration Service User Guide.
modify_event_subscriptionupdateregion, SubscriptionNameModifies an existing DMS event notification subscription.
delete_event_subscriptiondeleteregionDeletes an DMS event subscription.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Lists all the event subscriptions for a customer account. The description of a subscription includes SubscriptionName, SNSTopicARN, CustomerID, SourceType, SourceID, CreationTime, and Status. If you specify SubscriptionName, this action lists the description for that subscription.

SELECT
cust_subscription_id,
customer_aws_id,
enabled,
event_categories_list,
sns_topic_arn,
source_ids_list,
source_type,
status,
subscription_creation_time
FROM aws.dms.event_subscriptions
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an DMS event notification subscription. You can specify the type of source (SourceType) you want to be notified of, provide a list of DMS source IDs (SourceIds) that triggers the events, and provide a list of event categories (EventCategories) for events you want to be notified of. If you specify both the SourceType and SourceIds, such as SourceType = replication-instance and SourceIdentifier = my-replinstance, you will be notified of all the replication instance events for the specified source. If you specify a SourceType but don't specify a SourceIdentifier, you receive notice of the events for that source type for all your DMS sources. If you don't specify either SourceType nor SourceIdentifier, you will be notified of events generated from all DMS sources belonging to your customer account. For more information about DMS events, see Working with Events and Notifications in the Database Migration Service User Guide.

INSERT INTO aws.dms.event_subscriptions (
SubscriptionName,
SnsTopicArn,
SourceType,
EventCategories,
SourceIds,
Enabled,
Tags,
region
)
SELECT
'{{ SubscriptionName }}' /* required */,
'{{ SnsTopicArn }}' /* required */,
'{{ SourceType }}',
'{{ EventCategories }}',
'{{ SourceIds }}',
{{ Enabled }},
'{{ Tags }}',
'{{ region }}'
RETURNING
event_subscription
;

UPDATE examples

Modifies an existing DMS event notification subscription.

UPDATE aws.dms.event_subscriptions
SET
SubscriptionName = '{{ SubscriptionName }}',
SnsTopicArn = '{{ SnsTopicArn }}',
SourceType = '{{ SourceType }}',
EventCategories = '{{ EventCategories }}',
Enabled = {{ Enabled }}
WHERE
region = '{{ region }}' --required
AND SubscriptionName = '{{ SubscriptionName }}' --required
RETURNING
event_subscription;

DELETE examples

Deletes an DMS event subscription.

DELETE FROM aws.dms.event_subscriptions
WHERE region = '{{ region }}' --required
;