EventSubscription
The EventSubscription resource lets you manage AWS DocDB EventSubscriptions for monitoring events related to your Amazon DocumentDB clusters.
Minimal Example
Section titled “Minimal Example”Create a basic event subscription with the required SNS topic ARN and a subscription name.
import AWS from "alchemy/aws/control";
const basicEventSubscription = await AWS.DocDB.EventSubscription("basicSubscription", { SnsTopicArn: "arn:aws:sns:us-west-2:123456789012:my-sns-topic", SubscriptionName: "mySubscription", Enabled: true});
Advanced Configuration
Section titled “Advanced Configuration”Configure an event subscription with specific event categories and source IDs to tailor notifications.
const advancedEventSubscription = await AWS.DocDB.EventSubscription("advancedSubscription", { SnsTopicArn: "arn:aws:sns:us-west-2:123456789012:my-sns-topic", SubscriptionName: "advancedSubscription", Enabled: true, EventCategories: ["creation", "deletion"], SourceIds: ["cluster-1", "cluster-2"]});
Adopt Existing Resource
Section titled “Adopt Existing Resource”If you want to adopt an existing event subscription instead of failing when it already exists, you can set the adopt property to true.
const adoptEventSubscription = await AWS.DocDB.EventSubscription("existingSubscription", { SnsTopicArn: "arn:aws:sns:us-west-2:123456789012:my-sns-topic", SubscriptionName: "existingSubscription", Enabled: true, adopt: true});