Skip to content

EventTopic

Source: src/AWS/DirectoryService/EventTopic.ts

An association between an AWS Directory Service Directory and an Amazon SNS topic. The directory publishes a status message to the topic whenever it changes stage — e.g. from Active to Impaired or Inoperable, and back to Active — which is Directory Service’s native event mechanism.

To consume the notifications from a Lambda function, use consumeDirectoryStatus, which creates this association and subscribes the function to the topic.

const topic = yield* SNS.Topic("DirectoryStatus", {});
const eventTopic = yield* DirectoryService.EventTopic("Status", {
directoryId: directory.directoryId,
topicName: topic.topicName,
});