aws ecs list-task-definitions
Returns a list of task definitions that are registered to your account. AWS CLI reference
2 examples 5 options Its page in the AWS CLI reference
Examples
Example 1: To list the registered task definitions
The following list-task-definitions example lists all of the registered task definitions.
aws ecs list-task-definitionsIdentifyIts output
{
"taskDefinitionArns": [
"arn:aws:ecs:us-west-2:123456789012:task-definition/sleep300:2",
"arn:aws:ecs:us-west-2:123456789012:task-definition/sleep360:1",
"arn:aws:ecs:us-west-2:123456789012:task-definition/wordpress:3",
"arn:aws:ecs:us-west-2:123456789012:task-definition/wordpress:4",
"arn:aws:ecs:us-west-2:123456789012:task-definition/wordpress:5",
"arn:aws:ecs:us-west-2:123456789012:task-definition/wordpress:6"
]
}For more information, see Amazon ECS task definitions in the Amazon ECS Developer Guide.
Example 2: To list the registered task definitions in a family
The following list-task-definitions example lists the task definition revisions of a specified family.
aws ecs list-task-definitions --family-prefix wordpressIdentify--family-prefixThe full family name to filter the ListTaskDefinitions results with.Its output
{
"taskDefinitionArns": [
"arn:aws:ecs:us-west-2:123456789012:task-definition/wordpress:3",
"arn:aws:ecs:us-west-2:123456789012:task-definition/wordpress:4",
"arn:aws:ecs:us-west-2:123456789012:task-definition/wordpress:5",
"arn:aws:ecs:us-west-2:123456789012:task-definition/wordpress:6"
]
}For more information, see Amazon ECS task definitions in the Amazon ECS Developer Guide.
Options
--family-prefixThe full family name to filter the ListTaskDefinitions results with.--max-resultsThe maximum number of task definition results that ListTaskDefinitions returned in paginated output.--next-tokenThe nextToken value returned from a ListTaskDefinitions request indicating that more results are available to fulfill the request and further calls will be needed.--sortThe order to sort the results in.--statusThe task definition status to filter the ListTaskDefinitions results with.