From 1625cb87c25ef03ecabbcd5e0965a5de05fdd1bb Mon Sep 17 00:00:00 2001 From: Kathy Tran Date: Thu, 5 Dec 2024 17:07:11 -0500 Subject: [PATCH] Display task container names --- cloud-watch-to-slack-testing/deployment/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloud-watch-to-slack-testing/deployment/index.js b/cloud-watch-to-slack-testing/deployment/index.js index 3b2c448..8ccfc0e 100644 --- a/cloud-watch-to-slack-testing/deployment/index.js +++ b/cloud-watch-to-slack-testing/deployment/index.js @@ -258,6 +258,8 @@ function ecsTaskStateChangeMessageText(message) { const taskArn = message?.detail?.taskArn; const lastStatus = message?.detail?.lastStatus; let messageText = `Task ${taskArn} is now ${lastStatus}`; + const taskContainers = message?.detail?.containers?.map((container) => container.name).join(', '); + messageText += `\nTask containers: ${taskContainers}`; ["startedAt", "stoppedAt", "stoppedReason"].forEach((name) => { const value = message?.detail?.[name]; if (value != undefined) {