Skip to content

Commit

Permalink
update task stopped message
Browse files Browse the repository at this point in the history
  • Loading branch information
svonworl committed Jan 17, 2024
1 parent a7cd781 commit 2f19931
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cloud-watch-to-slack-testing/deployment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,18 @@ function ecsActivityMessageText(message) {
}

function ecsTaskStateChangeMessageText(message) {
const taskArn = message.resources[0];
const clusterArn = message.detail.clusterArn;
const taskArn = message.detail.taskArn;
const lastStatus = message.detail.lastStatus;
console.log(`Task ${taskArn} in cluster ${clusterArn} is now ${lastStatus}`);
return `Task is now ${lastStatus}`;
let messageText = `Task ${taskArn} is now ${lastStatus}`;
["startedAt", "startedBy", "stoppedAt", "stoppedReason"].forEach(

Check failure on line 261 in cloud-watch-to-slack-testing/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Replace `⏎····field` with `(field)`
field => {
const value = message.detail[field];

Check failure on line 263 in cloud-watch-to-slack-testing/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Delete `··`
if (value != undefined) {

Check failure on line 264 in cloud-watch-to-slack-testing/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Replace `······` with `····`
messageText += `\n${field}: ${value}`;

Check failure on line 265 in cloud-watch-to-slack-testing/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Delete `··`
}

Check failure on line 266 in cloud-watch-to-slack-testing/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Delete `··`
}

Check failure on line 267 in cloud-watch-to-slack-testing/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Replace `····}⏎··` with `··}`
);
return messageText;
}

function ecsAutoScalingMessageText(message) {
Expand Down

0 comments on commit 2f19931

Please sign in to comment.