I wonder when when deployment is considered successful for ecs fargate. I use code deploy events with my lambda, i receive event on successful deploy. I could not find any information about the criterias of assesing the deployment, i guess that happens after allowing traffic to the new taskset, but i need to know whether the whole traffic was shifted to the new taskset, if all of the tasks are healthy, if all of the old tasks are stopped. I also find a word "instance" in the docs quite often (found info that for successful deployment the specified number of "instances should be healthy), but i do not know how this is applicable to the fargate (instance == task?)
Fargate instance == task. An ECS instance is an instance of a task, not to be confused with EC2 instances.
As for a successful deployment, per the documentation:
After a successful deployment, the production traffic listener serves traffic to your new replacement task set and the original task set is terminated.
100% of traffic would have to be served by the new deployment, with all health checks passing on the new tasks, and the old tasks terminated, before it would consider a deployment successful.
If less than 100% of traffic was being served by your tasks, then the deployment would still be considered "in progress", since it is CodeDeploy's job to shift the traffic as part of the deployment, until it is 100% shifted.