AWS: ECS Error — One or more of the requested capabilities are not supported

AWS Jul 5, 2023

This errors throw out from my Github Action when deploy ECS task definition.

One or more of the requested capabilities are not supported

Task Definition

Here is my task definition.

{
  "family": "xxx",
  "executionRoleArn": "arn:aws:iam::xxx:role/ecsTaskExecutionRole",
  "networkMode": "awsvpc",
  "containerDefinitions": [
    {
      "name": "xxx",
      "image": "xxx.dkr.ecr.xxx.amazonaws.com/xxx:latest",
      "portMappings": [
        {
          "containerPort": 5555,
          "hostPort": 5555,
          "protocol": "tcp"
        }
      ],
       "environmentFiles": [
          {
              "value": "arn:aws:s3:::xxx/dev.env",
              "type": "s3"
          }
      ],
      "essential": true
    }
  ],
  "requiresCompatibilities": [
    "FARGATE"
  ],
  "cpu": "512",
  "memory": "1024"
}

Root Cause

From above task definition,

See the environmentFiles , this one need “Platform Version 1.4+”.

Solution: Upgrade to 1.4

Here below is the way to see the current version.

This is from the AWS ECS console.

Need Fargate 1.4.0

How to Upgrade to 1.4

You need to go inside the ECS cluster console and click “Update” on the top right

Dangerous Parameter

At the form, you must

  1. Set version to 1.4
  2. Check “Force new deployment”
Version is need to be exactly 1.4.0 not LATEST

Because someway Amazon think LATEST is latest stable i.e. 1.3.0 (At least as of Jan 2021)

The Fargate instance will be forced redeploy and you can trigger your Github action again.

I wrote to to myself in the future.

Also hope this help you guys as well.

Tags

TeamCMD

We are CODEMONDAY team and provide a variety of content about Business , technology, and Programming. Let's enjoy it with us.