Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/constructs/aws/Queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,12 @@ export class Queue extends AwsConstruct {

const alarmEmail = configuration.alarm;
if (alarmEmail !== undefined) {
// generate the display name, AWS restriction is 100 chars
const displayName = `[Alert][${id}] failed jobs in the DLQ.`.substring(0, 100);

const alarmTopic = new Topic(this, "AlarmTopic", {
topicName: `${this.provider.stackName}-${id}-dlq-alarm-topic`,
displayName: `[Alert][${id}] There are failed jobs in the dead letter queue.`,
displayName,
});
new Subscription(this, "AlarmTopicSubscription", {
topic: alarmTopic,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/queues.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ describe("queues", () => {
Properties: {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
TopicName: expect.stringMatching(/test-queues-\w+-dev-emails-dlq-alarm-topic/),
DisplayName: "[Alert][emails] There are failed jobs in the dead letter queue.",
DisplayName: "[Alert][emails] failed jobs in the DLQ.",
},
});
expect(cfTemplate.Resources[computeLogicalId("emails", "AlarmTopicSubscription")]).toMatchObject({
Expand Down