-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ecs run: InvalidParameterException thrown when running a task definition using awsvpc + EC2 launch type #133
Comments
Hi @jkcdarunday, when running a task in network mode "awsvpc", you have to provide the subnet and the security group - like you do in the web (in your screenshot). You can provide those in the call with:
All details and options you can see via Best |
Hi @fabfuel % ecs run staging projects -c projects "npm run initdb" --launch-type EC2 --securitygroup sg-xxxxxxxxx --subnet subnet-xxxxxxxxx
Using task definition: projects
Changed command of container "projects" to: "npm run initdb" (was: "[]")
An error occurred (InvalidParameterException) when calling the RunTask operation: Network Configuration must be provided when networkMode 'awsvpc' is specified. |
Looking at the code, it seems that no networkConfiguration value is being passed if the launch type is EC2 (it is only added on Fargate). Perhaps networkConfiguration should be passed for the EC2 launch type as well as EC2 also supports awsvpc? Lines 93 to 124 in fe7447a
|
Indeed, you're right |
I have tried to edit the code to always pass networkConfiguration regardless of launch type and it seems to be working with my fork's commit at jkcdarunday@6e8ee0d Should I do a pull request? I am not sure if specifying an awsvpcConfiguration affects task definitions that don't use awsvpc though as all of my services currently use awsvpc. % python ecs_deploy/cli.py run staging projects -c projects "npm run initdb" --securitygroup sg-xxxxxxxx --subnet subnet-xxxxxxxx
Using task definition: projects
Changed command of container "projects" to: "npm run initdb" (was: "[]")
Successfully started 1 instances of task: projects:4
- arn:aws:ecs:ap-southeast-1:xxxxxxxxx:task/staging/xxxxx |
Thanks @jkcdarunday, I think the safes way is to add a new argument for the network mode and to require and add the network config to the task definition only, if it is set to Best |
Hi,
I get the following when I try to use the run command on a task that use the EC2 launch type and awsvpc as the network mode:
Notes:
ecs run ...
does not work with Fargate #61 might be related, however, that issue is with using Fargate. Mine uses EC2 with awsvpc instead.The text was updated successfully, but these errors were encountered: