Task definition - Unknown parameter in input: "runtimePlatform"

0

Hi!
When I try to register a new task definition with a gravition architecture I receive an errror:

aws ecs register-task-definition --cli-input-json file://td_gravinton.json

Parameter validation failed:
Unknown parameter in input: "runtimePlatform", must be one of: family, taskRoleArn, executionRoleArn, networkMode, containerDefinitions, volumes, placementConstraints, requiresCompatibilities, cpu, memory, tags, pidMode, ipcMode, proxyConfiguration, inferenceAccelerators, ephemeralStorage

I follow the documentation but I don't what's the problem.

Thank you!

quique
asked 2 years ago1158 views
4 Answers
0

Could you share the input file (td_graviton.json) and the version of the AWS CLI you're using?

Thanks!

profile pictureAWS
Mats
answered 2 years ago
0

Thank you Mats.
I tried with this json:

{
"runtimePlatform": {
"cpuArchitecture": "ARM64",
"operatingSystemFamily": "LINUX"
},
"containerDefinitions": [
{
"name": "containerName",
"image": "xxxxxxxxxxxxxxxxxxxxx",
"cpu": 2048,
"memory": 4096,
"portMappings": [
{
"containerPort": 80,
"hostPort": 80,
"protocol": "tcp"
},
{
"containerPort": 22,
"hostPort": 22,
"protocol": "tcp"
}
],
"essential": true,
"environment": [
{
"name": "ENV",
"value": "PRE"
}
],
"mountPoints": [],
"volumesFrom": []
}
],
"family": "familyName",
"taskRoleArn": "xxxxxxxxxxxx",
"executionRoleArn": "xxxxxxxxxxxxxxxx",
"networkMode": "awsvpc",
"volumes": [],
"placementConstraints": [],
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "2048",
"memory": "4096"
}

And I tried with this too (example in documentation):

{
"family": "bb-arm64",
"networkMode": "awsvpc",
"containerDefinitions": [
{
"name": "sleep",
"image": "arm64v8/busybox",
"cpu": 100,
"memory": 100,
"essential": true,
"command": [ "echo hello" ],
"entryPoint": [ "sh", "-c" ]
}
],
"requiresCompatibilities": [ "FARGATE" ],
"cpu": "1 vCpu",
"memory": "3 GB",
"runtimePlatform": { "cpuArchitecture": "ARM64" },
"executionRoleArn": "arn:aws:iam::1234567890:role/ecsTaskExecutionRole"
}

In both cases I get the same error, it does not recognize the parameter "runtimePlatform"

My aws client version is:
#aws --version
aws-cli/2.2.46 Python/3.9.7 Darwin/19.6.0 source/x86_64 prompt/off

Thank you!!

quique
answered 2 years ago
0

Apologies for the delay in responding. I'm unable to repro the issue.

For reference, I'm using AWS CLI v2:

$ aws --version
aws-cli/2.4.3 Python/3.8.8 Linux/5.4.72-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off

With this, and slightly modifying the task definition you provided (specifying busybox as the container and providing a task execution role in my account), I'm able to successfully create the task definition:

{
"runtimePlatform": {
"cpuArchitecture": "ARM64",
"operatingSystemFamily": "LINUX"
},
"containerDefinitions": [
{
"name": "containerName",
"image": "arm64v8/busybox",
"cpu": 2048,
"memory": 4096,
"portMappings": [
{
"containerPort": 80,
"hostPort": 80,
"protocol": "tcp"
},
{
"containerPort": 22,
"hostPort": 22,
"protocol": "tcp"
}
],
"essential": true,
"environment": [
{
"name": "ENV",
"value": "PRE"
}
],
"mountPoints": [],
"volumesFrom": []
}
],
"family": "forum-post-td-1",
"executionRoleArn": "arn:aws:iam::ACCOUNT-ID-GOES-HERE:role/ecsTaskExecutionRole",
"networkMode": "awsvpc",
"volumes": [],
"placementConstraints": [],
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "2048",
"memory": "4096"
}

profile pictureAWS
Mats
answered 2 years ago
0

I had the same issue and was able to solve by updating to the latest version of the awscli here https://aws.amazon.com/cli/. Note that I had to uninstall my version installed by brew which was lagging the latest release.

answered 2 years ago

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