0
votes

I use CodeBuild to deploy containers to AWS ECS cluster. Inside CodeBuild I've "aws ecs register-task-definition" and "aws ecs update-service" to register task definition and update the service with new task def. I have SNS subscription for changing ECS cluster state and I receive these notification for states in this order:

  1. “PENDING to RUNNING”
  2. “RUNNING to RUNNING"
  3. “RUNNING to STOPPED"
  4. “STOPPED to STOPPED”

Regarding AWS documentation I understand that the states PENDING to RUNNING and RUNNING to STOPPED meaning that ECS Agent receives new tasks to start.

My question is what are other state means?

1

1 Answers

1
votes

There are two status for an ECS task. lastStatus means the current task status. desiredStatus means the targeted status.

During a task start and stop, there will be 4 events omitted:

  1. (lastStatus: PENDING)-> (desiredStatus: RUNNING): The task is scheduled to run
  2. (lastStatus: RUNNING)-> (desiredStatus: RUNNING): The task is started. There will be more data in the events such as network info, which is only available after task started.
  3. (lastStatus: RUNNING)-> (desiredStatus: STOPPED): The task is scheduled to stop
  4. (lastStatus: STOPPED)-> (desiredStatus: STOPPED): The task is stopped