v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1456373564.1 KB

Describes a specified task or tasks.

Currently, stopped tasks appear in the returned results for at least one hour.

post/#X-Amz-Target=AmazonEC2ContainerServiceV20141113.DescribeTasks

Headers

X-Amz-Target'AmazonEC2ContainerServiceV20141113.DescribeTasks' required

Request body

clusterstring

The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task or tasks to describe. If you do not specify a cluster, the default cluster is assumed. This parameter is required if the task or tasks you are describing were launched in any cluster other than the default cluster.

tasksString[] required

A list of up to 100 task IDs or full ARN entries.

includeTaskField[]

Specifies whether you want to see the resource tags for the task. If <code>TAGS</code> is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.

Response

Success

Example response

{
  "failures": [],
  "tasks": [
    {
      "clusterArn": "arn:aws:ecs:<region>:<aws_account_id>:cluster/default",
      "containerInstanceArn": "arn:aws:ecs:<region>:<aws_account_id>:container-instance/18f9eda5-27d7-4c19-b133-45adc516e8fb",
      "containers": [
        {
          "name": "ecs-demo",
          "containerArn": "arn:aws:ecs:<region>:<aws_account_id>:container/7c01765b-c588-45b3-8290-4ba38bd6c5a6",
          "lastStatus": "RUNNING",
          "networkBindings": [
            {
              "bindIP": "0.0.0.0",
              "containerPort": 80,
              "hostPort": 80
            }
          ],
          "taskArn": "arn:aws:ecs:<region>:<aws_account_id>:task/c5cba4eb-5dad-405e-96db-71ef8eefe6a8"
        }
      ],
      "desiredStatus": "RUNNING",
      "lastStatus": "RUNNING",
      "overrides": {
        "containerOverrides": [
          {
            "name": "ecs-demo"
          }
        ]
      },
      "startedBy": "ecs-svc/9223370608528463088",
      "taskArn": "arn:aws:ecs:<region>:<aws_account_id>:task/c5cba4eb-5dad-405e-96db-71ef8eefe6a8",
      "taskDefinitionArn": "arn:aws:ecs:<region>:<aws_account_id>:task-definition/amazon-ecs-sample:1"
    }
  ]
}