ECS Fargate task stop with a message on the web console: Your Spot Task was interrupted.
0
Hello developers,
I had initiated a SPOT ECS Fargate task which stopped after running sometime with a message (JS Code is written in node:14-alpine):
"Your Spot Task was interrupted."
Task Docker Container:
FROM node:14-alpine
Code: NodeJS
However, my process.on code didn't fire-up:
process.on('SIGTERM', async () => {
console.log("The service is about to shut down!");
process.exit(0);
});
Any clue why code didn't capture the "SIGTERM" event?