2

I run the command to run my ecs task:

**aws ecs run-task --cluster tryimport --task-definition fromecr --network-configuration { security_groups: ["sg-e9bh4ab9"], subnets: ["subnet-0b170efc0b8f6f53b"]}

zsh: parse error near `}'**

What am i doing wrong?

David
  • 2,926
  • 1
  • 27
  • 61

1 Answers1

6

Thanks to @luk3202, i corrected.

But as well, i had to specify the launch-type="FARGATE", see also: AWS ECS Error when running task: No Container Instances were found in your cluster

and also {"assignPublicIp": "ENABLED" ...

Thus in my example the solution is:

aws ecs run-task  --cluster tryimport --task-definition fromecr:2 --launch-type="FARGATE" --network-configuration '{ "awsvpcConfiguration": { "assignPublicIp":"ENABLED", "securityGroups": ["sg-e9bd4ab9"], "subnets": ["subnet-0b170efc0b8f6f53b"]}}'
Pwnosaurus
  • 2,058
  • 1
  • 19
  • 21
David
  • 2,926
  • 1
  • 27
  • 61
  • There is a small typo after ENABLED in the sample : its missing a " character. If you can correct that :) – Romain Feb 13 '23 at 16:55