create_event_subscription
¶
create_event_subscription(
*,
config_overrides: Optional[NeptuneClientConfig] = None,
subscription_name: Optional[String] = None,
sns_topic_arn: Optional[String] = None,
source_type: Optional[String] = None,
event_categories: Optional[EventCategoriesList] = None,
source_ids: Optional[SourceIdsList] = None,
enabled: Optional[BooleanOptional] = None,
tags: Optional[TagList] = None,
) -> CreateEventSubscriptionResult
Creates an event notification subscription. This action requires a topic ARN (Amazon Resource Name) created by either the Neptune console, the SNS console, or the SNS API. To obtain an ARN with SNS, you must create a topic in Amazon SNS and subscribe to the topic. The ARN is displayed in the SNS console.
You can specify the type of source (SourceType) you want to be notified of, provide a list of Neptune sources (SourceIds) that triggers the events, and provide a list of event categories (EventCategories) for events you want to be notified of. For example, you can specify SourceType = db-instance, SourceIds = mydbinstance1, mydbinstance2 and EventCategories = Availability, Backup.
If you specify both the SourceType and SourceIds, such as SourceType = db-instance and SourceIdentifier = myDBInstance1, you are notified of all the db-instance events for the specified source. If you specify a SourceType but do not specify a SourceIdentifier, you receive notice of the events for that source type for all your Neptune sources. If you do not specify either the SourceType nor the SourceIdentifier, you are notified of events generated from all Neptune sources belonging to your customer account.
Parameters:
-
subscription_name(Optional[String], default:None) –The name of the subscription.
Constraints: The name must be less than 255 characters.
-
sns_topic_arn(Optional[String], default:None) –The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.
-
source_type(Optional[String], default:None) –The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. if this value is not specified, all events are returned.
Valid values:
db-instance|db-cluster|db-parameter-group|db-security-group|db-snapshot|db-cluster-snapshot -
event_categories(Optional[EventCategoriesList], default:None) –A list of event categories for a SourceType that you want to subscribe to. You can see a list of the categories for a given SourceType by using the DescribeEventCategories action.
-
source_ids(Optional[SourceIdsList], default:None) –The list of identifiers of the event sources for which events are returned. If not specified, then all sources are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive hyphens.
Constraints:
-
If SourceIds are supplied, SourceType must also be provided.
-
If the source type is a DB instance, then a
DBInstanceIdentifiermust be supplied. -
If the source type is a DB security group, a
DBSecurityGroupNamemust be supplied. -
If the source type is a DB parameter group, a
DBParameterGroupNamemust be supplied. -
If the source type is a DB snapshot, a
DBSnapshotIdentifiermust be supplied.
-
-
enabled(Optional[BooleanOptional], default:None) –A Boolean value; set to true to activate the subscription, set to false to create the subscription but not activate it.
-
tags(Optional[TagList], default:None) –The tags to be applied to the new event subscription.
Raises:
-
EventSubscriptionQuotaExceededFault–You have exceeded the number of events you can subscribe to.
-
SNSInvalidTopicFault–The SNS topic is invalid.
-
SNSNoAuthorizationFault–There is no SNS authorization.
-
SNSTopicArnNotFoundFault–The ARN of the SNS topic could not be found.
-
SourceNotFoundFault–The source could not be found.
-
SubscriptionAlreadyExistFault–This subscription already exists.
-
SubscriptionCategoryNotFoundFault–The designated subscription category could not be found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_neptune/_services/neptune.py
1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 | |