Skip to content

DescribeTasks

Source: src/AWS/ECS/DescribeTasks.ts

Runtime binding for ecs:DescribeTasks.

Bind this operation to a Cluster inside a function runtime to get a callable that describes tasks in the bound cluster. The cluster ARN is injected automatically and the host is granted ecs:DescribeTasks on the cluster’s tasks.

const describeTasks = yield* AWS.ECS.DescribeTasks(cluster);
const response = yield* describeTasks({ tasks: [taskArn] });
const status = response.tasks?.[0]?.lastStatus;
const exitCode = response.tasks?.[0]?.containers?.[0]?.exitCode;