event_subscriptions
Creates, updates, deletes, gets or lists an event_subscriptions resource.
Overview
| Name | event_subscriptions |
| Type | Resource |
| Id | aws.dms.event_subscriptions |
Fields
The following fields are returned by SELECT queries:
- describe_event_subscriptions
| Name | Datatype | Description |
|---|---|---|
cust_subscription_id | string | The DMS event notification subscription Id. |
customer_aws_id | string | The Amazon Web Services customer account associated with the DMS event notification subscription. |
enabled | boolean | Boolean value that indicates if the event subscription is enabled. |
event_categories_list | array | A lists of event categories. |
sns_topic_arn | string | The topic ARN of the DMS event notification subscription. |
source_ids_list | array | A list of source Ids for the event subscription. |
source_type | string | The type of DMS resource that generates events. Valid values: replication-instance | replication-server | security-group | replication-task |
status | string | The 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_time | string | The time the DMS event notification subscription was created. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_event_subscriptions | select | region | 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. | |
create_event_subscription | insert | region, SubscriptionName, SnsTopicArn | 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. | |
modify_event_subscription | update | region, SubscriptionName | Modifies an existing DMS event notification subscription. | |
delete_event_subscription | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_event_subscriptions
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
- create_event_subscription
- Manifest
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
;
# Description fields are for documentation purposes
- name: event_subscriptions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the event_subscriptions resource.
- name: SubscriptionName
value: "{{ SubscriptionName }}"
description: |
The name of the DMS event notification subscription. This name must be less than 255 characters.
- name: SnsTopicArn
value: "{{ SnsTopicArn }}"
description: |
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.
- name: SourceType
value: "{{ SourceType }}"
description: |
The type of 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 | replication-task
- name: EventCategories
value:
- "{{ EventCategories }}"
description: |
A list of event categories for a source type that you want to subscribe to. For more information, see Working with Events and Notifications in the Database Migration Service User Guide.
- name: SourceIds
value:
- "{{ SourceIds }}"
description: |
A list of identifiers for which 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.
- name: Enabled
value: {{ Enabled }}
description: |
A Boolean value; set to true to activate the subscription, or set to false to create the subscription but not activate it.
- name: Tags
description: |
One or more tags to be assigned to the event subscription.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
ResourceArn: "{{ ResourceArn }}"
UPDATE examples
- modify_event_subscription
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
- delete_event_subscription
Deletes an DMS event subscription.
DELETE FROM aws.dms.event_subscriptions
WHERE region = '{{ region }}' --required
;