AWS CLI ECS WAIT Command in Jenkinsfile

0

Hi guys, I've pipeline for creating ecs services. As you know, when you use 'aws ecs run-task' the command does not wait until running process it gives output immedeately. You could use sleep 300 command etc to wait updating ecs status to running state.

I found this command on cli aws ecs wait tasks-running --cluster ${clusterName} --tasks ${TASK_ID} But it gives

Waiter TasksRunning failed: Waiter encountered a terminal failure state

OR

Waiter TasksRunning failed: Waiter encountered a terminal failure state: For expression "tasks[].lastStatus" we matched expected path: "STOPPED" at least once

Any idea?

2개 답변
1

Hello there,

The error message is self-explanatory. It implies that one of the tasks in the task lists you are trying to wait on is in a STOPPED state.

You should run the describe command below to confirm all the task status and see the one in stopped state while that error message is still being reported for the aws ecs wait tasks-running command:

% aws ecs describe-tasks \
    --cluster ${clusterName} \
    --tasks ${TASK_IDS} \
    --query 'tasks[*].containers[*].[lastStatus,taskArn]' --output text

For more info on this command, refer to the documentation here.

AWS
Olawale
답변함 2년 전
0

STOPPED one is okay I can understand the output. But the first one has not more output just Waiter TasksRunning failed: Waiter encountered a terminal failure state

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠