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?

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠