1
votes

I am trying to create a ECS fargate type task on ECS through this command aws ecs register-task-definition --family ${FAMILY} --cli-input-json file://${NAME}-v_${BUILD_NUMBER}.json --region ${REGION} as mentined in docs here. Task defination file is given below

task definition Every thing seems to work well with this command and have proper response in CLI. But when i try to do the same in Jenkins as i have to setup CI environment it gives following error.

Parameter validation failed:
Unknown parameter in input: "cpu", must be one of: family, taskRoleArn, 
networkMode, containerDefinitions, volumes
Unknown parameter in input: "executionRoleArn", must be one of: family, 
taskRoleArn, networkMode, containerDefinitions, volumes
Unknown parameter in input: "memory", must be one of: family, taskRoleArn, 
networkMode, containerDefinitions, volumes
Unknown parameter in input: "requiresCompatibilities", must be one of: 
family, taskRoleArn, networkMode, containerDefinitions, volumes

If i removed those tags in task definition json file. It creates a EC2 type task which i don't need. I want to create only a fargate launch type task. Jekins commands

2
I can't tell from your screenshot, what did you specify as the "launch-type" when creating your ecs service?Roy Kachouh
Launch type is fargate. Have a look on first screenshot there is a key having name "requiresCompatibilities"Najeeb Idrees

2 Answers

6
votes

From your terminal, type

which aws

and from Jenkins, execute the same command.

My guess is you'll find you are using two separate aws cli binaries (and one of them is too old to support Fargate.)

1
votes

Actually, I have two different aws cli's installed. And one was too old to support Fargate. I have updated cli installed on root level while jenkins user uses out of dated cli which does not support Fargate.