Skip to content

aws ecs describe-task-definition does not include restartPolicy into containerDefinitions items #9445

Closed
@jay-79

Description

@jay-79

Describe the bug

From the below CLI documentation there should be restartPolicy into each containerDefinitions items but it is missing.

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ecs/describe-task-definition.html

I have a task definition with a container definition that include a restart policy settings. When I check the JSON value of my task definition from the AWS Console UI, I can see the restartPolicy. But when I use AWS CLI ecs describe-task-definition command, the restartPolicy item is missing into produced JSON.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Get the same JSON file describing ECS task definition from AWS CLI as AWS Console UI.

Current Behavior

Task definition from AWS Console UI :

Image

Task definition from AWS CLI, restartPolicy is missing (next to essential) :

{
    "taskDefinition": {
        "taskDefinitionArn": "arn:aws:ecs:eu-west-3:XXXXXXXX:task-definition/backend:22",
        "containerDefinitions": [
            {
                "name": "backend",
                "image": "XXXXXXXXX.dkr.ecr.eu-west-3.amazonaws.com/backend:latest",
                "cpu": 3840,
                "memory": 6144,
                "memoryReservation": 4096,
                "portMappings": [
                    {
                        ...
                    }
                ],
                "essential": true,
                "environment": [
                    {
                        "name": "XXXXXX",
                        "value": "YYY"
                    }
                ],
                "environmentFiles": [],
                "mountPoints": [],
                "volumesFrom": [],
                "ulimits": [],
                "logConfiguration": {
                    "logDriver": "awslogs",
                    "options": {
                        ...
                    },
                    "secretOptions": []
                },
                "healthCheck": {
                    "command": [
                        ...
                    ],
                    "interval": 30,
                    "timeout": 5,
                    "retries": 3,
                    "startPeriod": 60
                },
                "systemControls": []
            }
        ],
        "family": "backend",
        "taskRoleArn": "XXXX",
        "executionRoleArn": "XXXX",
        "networkMode": "awsvpc",
        "revision": 22,
        "volumes": [],
        "status": "ACTIVE",
        "requiresAttributes": [...],
        "placementConstraints": [],
        "compatibilities": [
            "EC2",
            "FARGATE"
        ],
        "runtimePlatform": {
            "cpuArchitecture": "X86_64",
            "operatingSystemFamily": "LINUX"
        },
        "requiresCompatibilities": [
            "FARGATE"
        ],
        "cpu": "4096",
        "memory": "8192",
        "registeredAt": "XXXX",
        "registeredBy": "XXXX"
    },
    "tags": []
}

Reproduction Steps

Use below AWS CLI command :

aws ecs describe-task-definition --task-definition "<task_definition_name>" --region "<region>"

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.9.8

Environment details (OS name and version, etc.)

Linux, Mac OS, Docker

Metadata

Metadata

Labels

bugThis issue is a bug.ecsp3This is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions