ECS task defination: missing required attributes while deploying using AWS CLI

0

Hello,

Background:

I am trying to create new revision for ECS task. I am successful in registration. But unable to run the new definition. I am working using AWS CLI (not console)

Issue:

After couple of hours spent on investigation, found that issue with Require attributes which ECR related stuff is not getting added. I need some one help, why ECR related require attributes are not getting added. Due to this task is getting failed to pull data from ECR

Json entries for working revision and non working revision:

I have fetched Json format using aws describe command for both working revision and non functional revision definations

Working

"requiresAttributes": [
            {
                "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
            },
            {
                "name": "ecs.capability.execution-role-awslogs"
            },
            {
                "name": "com.amazonaws.ecs.capability.ecr-auth"
            },
            {
                "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
            },
            {
                "name": "ecs.capability.secrets.asm.environment-variables"
            },
            {
                "name": "com.amazonaws.ecs.capability.task-iam-role"
            },
            {
                "name": "ecs.capability.execution-role-ecr-pull"
            },
            {
                "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
            },
            {
                "name": "ecs.capability.task-eni"
            }
        ],

Non working

"requiresAttributes": [
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "ecs.capability.execution-role-awslogs"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "ecs.capability.secrets.asm.environment-variables"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.task-iam-role"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "ecs.capability.task-eni"
    }
  ],

Task definition:

Removed entries for security purpose.

{
  "containerDefinitions": [
    {
      "name": "bbbbbtask",
      "image": "aaaaaaaaaa1.dks.ecr.us-east-1.amazonaws.com/somerepo:0BVoLej",
      "cpu": 0,
      "portMappings": [],
      "essential": true,
      "entryPoint": [],
      "command": [
        "bundle",
        "exec",
        "rails",
        "xxxxxxxxxuyyy"
      ],
      "environment": [
      ...........
        }
      ],
      "mountPoints": [],
      "volumesFrom": [],
      "secrets": [

      .......
      ],
      "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
 ........
        }
      }
    }
  ],
  "family": "xxxxxxxxxx",
  "taskRoleArn": "xxxxxx,
  "executionRoleArn": "xxxxxxx",
  "networkMode": "awsvpc",
  "volumes": [],
  "placementConstraints": [],
  "runtimePlatform": {
    "operatingSystemFamily": "LINUX"
  },
  "requiresCompatibilities": [
    "FARGATE"
  ],
  "cpu": "1024",
  "memory": "2048"
}

Kindly help me to added ECR pull and ECR auth required attributes while deploying using AWS CLI.

  • Can you post the CLI commands you have tried?

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions