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
gefragt vor 3 Jahren1180 Aufrufe
4 Antworten
0

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

Thanks!

profile pictureAWS
Mats
beantwortet vor 3 Jahren
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
beantwortet vor 3 Jahren
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
beantwortet vor 2 Jahren
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.

beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen