Skip to content

Commit

Permalink
Update email.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jdinh8124 committed Jan 22, 2025
1 parent 2649eaa commit e642274
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions lib/stacks/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class Email extends cdk.NestedStack {

alarm.addAlarmAction(new cdk.aws_cloudwatch_actions.SnsAction(alarmTopic));

new CfnEventSourceMapping(this, "SinkSESTrigger", {
new CfnEventSourceMapping(this, "SinkSESTrigger1", {
batchSize: 1,
enabled: true,
selfManagedEventSource: {
Expand All @@ -242,13 +242,42 @@ export class Email extends cdk.NestedStack {
},
],
startingPosition: "LATEST",
topics: [`${topicNamespace}aws.onemac.migration.cdc`, `${topicNamespace}aws.seatool.ksql.onemac.three.agg.State_Planc`,],
topics: [`${topicNamespace}aws.onemac.migration.cdc`],
destinationConfig: {
onFailure: {
destination: dlq.queueArn,
},
},
});

new CfnEventSourceMapping(this, "SinkSESTrigger2", {
batchSize: 1,
enabled: true,
selfManagedEventSource: {
endpoints: {
kafkaBootstrapServers: brokerString.split(","),
},
},
functionName: processEmailsLambda.functionName,
sourceAccessConfigurations: [
...privateSubnets.map((subnet) => ({
type: "VPC_SUBNET",
uri: subnet.subnetId,
})),
{
type: "VPC_SECURITY_GROUP",
uri: `security_group:${lambdaSecurityGroup.securityGroupId}`,
},
],
startingPosition: "LATEST",
topics: [`${topicNamespace}aws.seatool.ksql.onemac.three.agg.State_Planc`],
destinationConfig: {
onFailure: {
destination: dlq.queueArn,
},
},
});


// Add CloudWatch alarms
new cdk.aws_cloudwatch.Alarm(this, "EmailProcessingErrors", {
Expand Down

0 comments on commit e642274

Please sign in to comment.