Skip to content

Commit 41ab5c3

Browse files
authored
Merge pull request #349 from cmcnicholas/feature/fix-alarm-naming
Fix #348 topic display name too long
2 parents 840ae57 + 8c8b7a2 commit 41ab5c3

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/constructs/aws/Queue.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,12 @@ export class Queue extends AwsConstruct {
254254

255255
const alarmEmail = configuration.alarm;
256256
if (alarmEmail !== undefined) {
257+
// generate the display name, AWS restriction is 100 chars
258+
const displayName = `[Alert][${id}] failed jobs in the DLQ.`.substring(0, 100);
259+
257260
const alarmTopic = new Topic(this, "AlarmTopic", {
258261
topicName: `${this.provider.stackName}-${id}-dlq-alarm-topic`,
259-
displayName: `[Alert][${id}] There are failed jobs in the dead letter queue.`,
262+
displayName,
260263
});
261264
new Subscription(this, "AlarmTopicSubscription", {
262265
topic: alarmTopic,

test/unit/queues.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ describe("queues", () => {
418418
Properties: {
419419
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
420420
TopicName: expect.stringMatching(/test-queues-\w+-dev-emails-dlq-alarm-topic/),
421-
DisplayName: "[Alert][emails] There are failed jobs in the dead letter queue.",
421+
DisplayName: "[Alert][emails] failed jobs in the DLQ.",
422422
},
423423
});
424424
expect(cfTemplate.Resources[computeLogicalId("emails", "AlarmTopicSubscription")]).toMatchObject({

0 commit comments

Comments
 (0)