Skip to content

EventDestination

Source: src/AWS/PinpointSMSVoiceV2/EventDestination.ts

An AWS End User Messaging SMS (Pinpoint SMS Voice v2) event destination — routes message events (sends, deliveries, failures) from a ConfigurationSet to CloudWatch Logs, Kinesis Data Firehose, or SNS.

Each configuration set holds up to five event destinations; each event destination references exactly one delivery target.

Stream all events to SNS

import * as PinpointSMSVoiceV2 from "alchemy/AWS/PinpointSMSVoiceV2";
import * as SNS from "alchemy/AWS/SNS";
const configSet = yield* PinpointSMSVoiceV2.ConfigurationSet("Messaging");
const events = yield* SNS.Topic("SmsEvents");
const destination = yield* PinpointSMSVoiceV2.EventDestination("Events", {
configurationSetName: configSet.configurationSetName,
matchingEventTypes: ["ALL"],
snsDestination: { topicArn: events.topicArn },
});

CloudWatch Logs destination

const destination = yield* PinpointSMSVoiceV2.EventDestination("Logs", {
configurationSetName: configSet.configurationSetName,
matchingEventTypes: ["TEXT_ALL"],
cloudWatchLogsDestination: {
iamRoleArn: role.roleArn,
logGroupArn: logGroup.logGroupArn,
},
});

Disable a destination without deleting it

const destination = yield* PinpointSMSVoiceV2.EventDestination("Events", {
configurationSetName: configSet.configurationSetName,
matchingEventTypes: ["ALL"],
snsDestination: { topicArn: events.topicArn },
enabled: false,
});