Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CLI returning Unknown options : awsvpcConfiguration

When i run the below command on aws-cli its throws an error 'returning Unknown options : awsvpcConfiguration'

e.g

aws ecs run-task --cluster test-ecs-cluster --task-definition testtask --launch-type FARGATE --network-configuration awsvpcConfiguration={subnets=["subnet-1234","subnet-12345"],securityGroups=["test"],assignPublicIp="DISABLED"}

i got the below error:

Unknown options: awsvpcConfiguration=securityGroups=[test], awsvpcConfiguration=assignPublicIp=DISABLED, awsvpcConfiguration=subnet-1234]

like image 530
Arockia Antony Avatar asked Feb 28 '20 11:02

Arockia Antony


1 Answers

Yes, because the way you specified it the AWS CLI interprets it a the parameter itself. But it's the parameter's value that is awsvpcConfiguration so this should work:

aws ecs run-task \
        --cluster test-ecs-cluster \
        --task-definition testtask \
        --launch-type FARGATE 
        --network-configuration "awsvpcConfiguration={subnets=['subnet-1234','subnet-12345'],securityGroups=['test'],assignPublicIp='DISABLED'}"

Background: awsvpcConfiguration is, as per the CLI docs a shorthand syntax, not a valid parameter (or: option) of the run-task command.

like image 89
Michael Hausenblas Avatar answered Sep 28 '22 02:09

Michael Hausenblas