diff --git a/src/constructs/aws/Queue.ts b/src/constructs/aws/Queue.ts index 133e28db..9e89c141 100644 --- a/src/constructs/aws/Queue.ts +++ b/src/constructs/aws/Queue.ts @@ -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, diff --git a/test/unit/queues.test.ts b/test/unit/queues.test.ts index 1ada3e5e..a7239d3b 100644 --- a/test/unit/queues.test.ts +++ b/test/unit/queues.test.ts @@ -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({